|
Please use the <pre> tags
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
Who has used the regexp object in system32\vbscipt.dll to parse the text string. I have tried it and make it work!
But i don't know why i can get only one match(that is the matches.GetCount()==1), even there are many exist. The next is my code:
void CInetSessionDlg::ParsePage(CString szPattern, CString szContent){
try{
if(m_regExp.CreateDispatch(__uuidof(RegExp)) == FALSE)
{
AfxMessageBox("CreateDispatch Failed!");
return;
}
m_regExp.SetIgnoreCase(TRUE);
m_regExp.SetPattern(LPCTSTR(szPattern));
if(m_regExp.Test(LPCSTR(szContent)))
{
ISubMatches matches = m_regExp.Execute(szContent);
for(long i = 0; i < matches.GetCount(); i++) {
IMatch2 match = matches.GetItem(i);
CString strLink = match.GetValue();
m_cbHref.AddString(strLink);
}
}
}
catch(_com_error& e)
{
AfxMessageBox("Com Error occurred!" + e.Description());
return;
}
}
in this implementation file's header file:
i defined the RegExp(copied from the file RegExp.tlh got from vbscript.dll)
struct __declspec(uuid("3f4daca4-160d-11d2-a8e9-00104b365c9f"))RegExp; // [ default ] interface IRegExp2
Why? Who can tell me how to use vbscript.dll in VC++ 6.0
This time, i have tried to use
and hope it will work.
Thank u two friends!
Sincerely, Davidlou
davidlou68@hotmail.com
|
|
|
|
|
ROTFL - this is EXCELLENT
Try putting returns between your lines of code. Does it appear more readable to you like this ?
I'm sorry, I can't answer your problem, but anyone who can will be more likely to if your post is easy to read IMO.
Good luck.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
ROTFL - this is EXCELLENT
Try putting returns between your lines of code. Does it appear more readable to you like this ?
I'm sorry, I can't answer your problem, but anyone who can will be more likely to if your post is easy to read IMO.
Good luck.
Oh, I used an & and lt or gt to get < >, by typing in <pre>, you coloured the bottom of your post. If you use stuff that looks like HTML tags, check the 'display this message as is' option, or they get stripped as HTML, and in this case, used. OTherwise, use & lt and & gt without the space to do < and >.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
Thanks a lot!
Now it looks some better!
Sincerely, Davidlou
davidlou68@hotmail.com
|
|
|
|
|
Nish is not solving your problem, he's tells you to use <pre> ... </pre> to wrap your code so it is readable.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
Hi,
I am reading the book Programing Windows with MFC,but the example(The Hello Application) that it gave in chapter 1 cannot be compiled in the vc++ 6,it shows the informations below:
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
libcd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Hello.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
Did the codes the book gave wrong? Or I should do anymore?
the codes are listed below:
Hello.h
class CMyApp : public CWinApp
{
public:
virtual BOOL InitInstance ();
};
class CMainWindow : public CFrameWnd
{
public:
CMainWindow ();
protected:
afx_msg void OnPaint ();
DECLARE_MESSAGE_MAP ()
};
Hello.cpp
#include <afxwin.h>
#include "Hello.h"
CMyApp myApp;
/////////////////////////////////////////////////////////////////////////
// CMyApp member functions
BOOL CMyApp::InitInstance ()
{
m_pMainWnd = new CMainWindow;
m_pMainWnd->ShowWindow (m_nCmdShow);
m_pMainWnd->UpdateWindow ();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////
// CMainWindow message map and member functions
BEGIN_MESSAGE_MAP (CMainWindow, CFrameWnd)
ON_WM_PAINT ()
END_MESSAGE_MAP ()
CMainWindow::CMainWindow ()
{
Create (NULL, _T ("The Hello Application"));
}
void CMainWindow::OnPaint ()
{
CPaintDC dc (this);
CRect rect;
GetClientRect (&rect);
dc.DrawText (_T ("Hello, MFC"), -1, &rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER);
}
//I am sorry to interrupt you but I am a beginner,so if you know the answer,please tell me,thanks.
YES, I am here.
|
|
|
|
|
You need to link with the MFC library [either statically or dynamically]
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
If you're writing this from a blank project, you need to read carefully how to set it up. I've learned what all the bits the wizard gives me do, but I've never started a project except through the wizard - it just makes more sense to me to let the compiler generate boiler plate code, although, as I say, I've also had a good dig through it and can do a lot of the wizard stuff by hand if I want/need to.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
Christian Graus wrote:
If you're writing this from a blank project, you need to read carefully how to set it up
There is not much to setting it up actually
1. Include the MFC headers
2. Link with MFC [statically or dynamically]
That's all...
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
Fair enough, but obviously the book would have told him how to do that and he's missed it.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
Christian Graus wrote:
Fair enough, but obviously the book would have told him how to do that and he's missed it.
Yeah, that sounds highly probable.
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
The problem is your project settings are set to link with the single-threaded C runtime. MFC requires the multi-threaded version (as indicated by the fact that it's trying to find thread-related functions).
Click Project->Settings, C++ tab, Code Generation category, and set the Use runtime library setting to Debug Multithreaded (for the debug config) or Multithreaded (for release).
--Mike--
Rollin' in my 5.0
With the rag-top down so my hair can blow.
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
thanks everybody answered this question.
yes,in the end of the chapter,the writer gave the step on how to build it.I have not read it.now everything is ok,thank you.
YES, I am here.
|
|
|
|
|
Hi,all
When I used ClassWizard to add the message handlers,VC++ 6.0 displayed the warning:
"ClassWizard was unable to rename file D:\DOCUME~1\Alpha\LOCALS~1\Temp\mfc78.tmp to F:\Program\MyProjects\vcpp32\ex14a\ex4aView.cpp. You may be able to rename this file by hand and prevent loss of data.Some updates may still be lost."
What's wrong with it? I remember that when I used classwizard to add message handlers of menu items,vc++ always shown this warning.Can anyone tell me the reason?
Thanks!
YES, I am here.
|
|
|
|
|
If that happened to me, I'd be deleting all my temporary files, uninstalling VC and reinstalling it. This is NOT normal.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
Hello,
I am tring to write a simple .exe that can show or hide another running exe.. for example I want to be able (from my dialog box) toggle (show,hide) a running instance of notepad.
Any ideas?
Rob
|
|
|
|
|
Never mind.. I figured it out..
|
|
|
|
|
How do I programmatically get the name of the computer a user is using to log into the network? If some one knows the regular way and the .net way I would REALLY appreciate it. Thanks chums!
... OK, let's try that again. What I meant was not a local call, but one over the network, where I know someone's login id and that they are logged into the domain, but want to know what computer they are using to get on the network.
|
|
|
|
|
|
I have placed a List Control into a small area of a scrollview, among other controls. The control is in Icon view with small icons and text lables.
When I call CreateDragImage the image I get is the small icon and a black rectangle where the text would be. How can I get around this? Either to make the text visible or to just have the image.
Happy programming!!
|
|
|
|
|
I see that every topic on Visual C++ on
the msdn website has a
"this topic is not being updated after .Net release"
tag in RED!!!!!!!
Is Microsoft killing off C++, MFC et al
|
|
|
|
|
Ugh, another person who doesn't have CLUE what is going on.
MICROSOFT IS NOT KILLING OF C++.
VISUAL C++ IS THE OLD PRODUCT.
THE NEW C++ COMPILER IS CONTAINED IN THE .NET DOCUMENTATION.
SEEEEEEEEEEEEE!!!!!!
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
ok smartypants, can u tell me how I access this
"help"? whats the link to the root of Visual C++
.Net help? God knows their help system was
bad enough, now they have to complicate things
like this!!
|
|
|
|
|
Anonymous wrote:
ok smartypants
That's one sure way to make sure he won't answer your question.
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|