|
project-->properties---->Linker--->additional dependenceis
Here add your .lib
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Thanks, I found examples of how to export functions but not how to import it into a project. Thanks Again
- Matt Newman / Anti-Linux Activist
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
It's seem that the App's m_pszAppName and m_pszExeName member only contain the module name,is there a way to get the App's full path?
Scratch
|
|
|
|
|
GetModuleFileName is one way to get it. GetFullPathName is another.
|
|
|
|
|
A Q&D way that has never failed (for me, at least) is to use value of "CWinApp::m_pszHelpFilePath", and just replace the extension with your app's extension (usually "EXE").
Peace!
-=- James.
|
|
|
|
|
when I delete a certain object I get an assertation
_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
what is this and how do I fix it? Am I forgetting to do something in the destructor?
Steve
Not all who wander are lost...
|
|
|
|
|
You have been writing to memory you haven't allocated.
|
|
|
|
|
Steve Severance wrote:
when I delete a certain object I get an assertation
_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
Several things may cause this:
o You are trying to delete an invalid pointer (or a valid pointer to a stack-allocated object)
o You are trying to delete something that has already been freed
o You are trying to delete a pointer that was not allocated off of the same heap you are trying to deallocate it on
o Something stepped over the beginning or end of the allocated memory, and trashed the heap's management information
o Your heap may be corrupted
Etc... Good luck! Hopefully, it is something simple like a double-delete.
Peace!
-=- James.
|
|
|
|
|
Ok this is quite a simple question, but..
In a modal dialog box message loop, how can
I make some code be executed as soon as
WM_INITDIALOG etc. has been processed and
the dialog is visible on screen?
Eg. I want something in the message loop like.......
case (dialog is now visible on screen):
{
blah;
blah;
}
I do not want to use any MFC.
Any thoughts/solutions welcome
|
|
|
|
|
You can do it in OnShowWindow(BOOL bShow) for example.
bShow will be true when the window is being activated or shown
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need ASP hosting? Check out 123HostNow.com
|
|
|
|
|
Isn't OnShowWindow MFC?
I am writing a non-MFC app..
I have tried
case WM_SHOWWINDOW:
{
blah;
}
But the message is sent just before the dialog box is drawn... I need a message or something that is sent
just after the dialog has been drawn....
|
|
|
|
|
This is a common problem. Set a flag (bInitDlgDone ) when your WM_INITDIALOG completes. In your WM_SHOWWINDOW handler, execute "blah" only if
bInitDlgDone is TRUE.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ok I tried the flag thing, but the code "blah" is still
executed before the dialog is actually visible on screen.
Am I doing something wrong?
myflag is initially set to FALSE...
// inside message loop for dialog
case WM_INITDIALOG:
{
myflag=TRUE;
return TRUE;
}
break;
case WM_SHOWWINDOW:
{
if (myflag==TRUE)
{
blah;
}
}
break;
|
|
|
|
|
SeNs wrote:
"blah" is still executed before the dialog is actually visible on screen.
Hmmm. How about if you post a command from within your WM_INITDIALOG handler and execute "blah" in the command handler? What I mean is:
case WM_INITDIALOG:
...
PostMessage (WM_COMMAND, ID_DO_BLAH);
return (TRUE);
case WM_COMMAND:
switch (wParam) {
case ID_DO_BLAH:
blah;
break;
...
}
return (TRUE);
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I waana check if my string end with exact word,then if its true remove it from the end of string.What is the idea?
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
The idea as I see it, like this:
CString csTheString, csLookupWord;
if(csTheString.Find(csLookupWord, csTheString.GetLength()-csLookupWord.GetLength) >= 0){
csTheString = csTheString.Left(csTheString.GetLength - csLookupWord.GetLength());
}
Maybe some mistakes, but you will see in debugger
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need ASP hosting? Check out 123HostNow.com
|
|
|
|
|
I got it now ,thanks
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Perhaps not the best solution, but...
CString string = "This is a string";
CString word = "string";
if (0 == string.Right(word.GetLength()).Compare(word) )
string = string.Left(string.GetLength()-word.GetLength());
/moliate
|
|
|
|
|
Thanks moliate,I will check this one too.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Hi!
I cannot make WMI work (on XP).
I connect to server _T("ROOT\\cimv2"), then:
pSvc
IWbemLocator *pLoc = NULL;
IWbemServices *pSvc = NULL;
...
BSTR bstrPath = SysAllocString(_T("Win32_BIOS"));
IWbemClassObject *pCDClass = 0;
hr = pSvc->GetObject(bstrPath, 0, NULL, &pCDClass, 0);
//this is ok - I have an object
VARIANT v;
ZeroMemory(&v, sizeof(v));//with or without...
CIMTYPE type = CIM_STRING;
LONG fla = 0;
hr = pCDClass->Get(_T("Description"), 0, &v, &type, &fla);
This is ok too - IWbemClassObject::Get() method succeeded, but
VARIANT has VT_NULL.
How to get value of property "Description" from Win32_BIOS ?
|
|
|
|
|
I have a SMTP mailer component with 8 worker threads sending mails. The problem is that I want to fire event when mail issent and I want to fire event when all mails are sent. The problem is that one of my worker threads has to fire event by asking main thread to fire event. But this doesnt work that way it gives error in kernel32. What seems to be the problem and how can i solve it. I can only fire event when I dont have any thread working.
I am using MFC not ATL. When I handle event in VB it gives error ACCESS VIOLATION. I am just parsing the pointer of control class to worker thread to call the public function of control to fire event.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
i #include <wabapi.h> and get many errors
like am i really so stupid or crap at coding that i should take up herb farming in new mexico?
please point me in the right direction or put a bullet in my brain
---
"all's fair in love and war but in love there is no geneva convention"
|
|
|
|
|
Gosh!!!
This is a most un-lauren-like post lauren.
Nish
Has anyone seen my sig?
|
|
|
|
|
Ok, dumbass
Post a few of the errors maybe?
Personally, i'd avoid the bullet-in-brain thing, it sounds unpleasant. The herb thing sounds good though... (Mmmm, herb)
Sometimes i only remember, The days when i was young Nowadays no one remembers when they were young and stupid... ADEMA, The Way You Like It
|
|
|
|
|
Sounds like when I include winsock2.h before windows.h (maybe it's the other way around, don't remember ), then I get 200+ compile errors, but if I just swaps the 2 includes everything compiles fine.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|