|
It'll be quite hard, since .lib may have no information on function arguments/return type. And even if it has, it'll be name-mangled.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
Thanks,
I guess I'll have to do it manually then.
Wim
|
|
|
|
|
It's quite easy to use the symbol API to unmangle names. Take a look at the function UnDecorateSymbolName in the MSDN. Although it is also possible, like Tomasz said, that the .lib file won't have any names in it.
Chris Richardson
|
|
|
|
|
In my application, i want to use FindWindow(className, windowTitle) to
determine whether an instance of this application has already been running.
But what is the class name registered by MFC? let's say, the project name is
"Myapp", and classes CMyappApp, CMyappDoc, CMyappView, CMainFrame are created
by VC++. i tried them but none worked. Please help me! Thanks a lot!!!!
|
|
|
|
|
MFC creates class names on the fly using 'Afx' prefix and hex values for background brush/cursor/window style.
FindWindow isn't the way to go for determining if app is already running, at least not with class/caption only. You should consider using named mutex for that; there should be some articles right here on CP.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
I'm wondering if there's a way to check what's in a DC. I'm loading a cropped bitmap into a DC then blit it to another DC but I have no output. So I would like to test and make sure the original DC actually contains the bitmap I want.
Thanks.
|
|
|
|
|
You may try to select some other bitmap into destination DC. SelectObject returns previously selected object.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
Ok, got it thanks. Well everything seems to work fine. Except writing to the file.
Here's what I'm doing.
I load the (cropped image)CBitmap into a DC. That works.
So then I load (LoadImage()) a blank bmp file into another CBitmap to put into the second DC.
Then I BitBlt() the DC's.
In theory, from what I understand it should blit to the file through the DC. But it's not working, the blank image stays blank.
Is what I'm doing possible?
|
|
|
|
|
Mike Savoie wrote:
from what I understand it should blit to the file through the DC
Sorry - you got it totally wrong. BitBlt changes bitmap in memory. Changes are not saved to disk; in fact, AFAIK, there's no Win32 API which writes .bmp files. You have implement it yoursel. Check MFC sample DIBLOOK for code which saves bitmaps.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
I've developed an Activex control in VC++. Now i want to use it in a VB application. The control fires three types of events. In VB application, whenever the event is received, i displayed a message box. Here is the problem: Whenever event is received and Mesagebox is displayed, the next event may fired from the control, but this event is not captured by the VB application, because it is locked showing the dialog box on previous event.
Can anyone tell me how can i modify my code so that this problem is resolved and whenever new event is received, a new dialog box comes "above" the previous one ???
|
|
|
|
|
Show each messagebox in a different thread.
-----------------------
New and improved: kwakkelflap.com
My first CP article: Pseudoregisters[^]
"When I hear of Schrödinger's cat, I reach for my gun." - Stephen Hawking
|
|
|
|
|
Or create a non system or task modal messagebox.
Todd Smith
|
|
|
|
|
I put breakpoints and TRACEs in my code. With breakpoints, execution steps along quite a ways before the crash I'm debugging happens. Without breakpoints, if I run it with F5, during which I expect to see TRACE statements occur, the app crashes before any trace statement is visible. Isnt this the way we use TRACE? What am I doing wrong? If not, what might be the cause of this weird behavior?
Appreciate your help,
ns
|
|
|
|
|
If you emit *lots* of data with TRACE, some may be lost. This is 'by design' - see KB article Q218007.
However, the symptoms you've described suggest some problem with multiple threads. Are you multithreading?
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
No. Its single threaded. I just had three TRACEs in this routine..
the problem is that the app behaves very erratically from run to run (always crashes due to the erratic behavior). What it should do is populate a few database columns with entries for all records, then proceed. I do this, and sometimes one column is filled. Sometimes 2...but never all. Often no columns that I need done are populated.
itNotIn1 = setNotInSet1.begin();
for (; itNotIn1 != setNotInSet1.end(); itNotIn1++)
{
TRACE("before pop1");
CString temp = *itNotIn1;
m_db1.PopulatedontCares(*itNotIn1);
TRACE("After pop1");
}
In my latest attempt with breakpoints it did go into PopulatedontCares and return successfully, but when I checked the database, the columns were still empty:
while (!rsDontCares->GetadoEOF ())
{
rsDontCares->Fields->GetItem(fldName0)->Value = xDontCare0;
rsDontCares->Update();
rsDontCares->MoveNext ();
}
I'd tried UpdateBatch as well...
Dont know if you can help....but thanks anyways...
Appreciate your help,
ns
|
|
|
|
|
The 'sometimes' part of problem suggests that you're using uninitialized data somewhere or overwriting memory blocks. Try to simplify PopulateDontcare - what happens if you don't write anything to database? Does program still crash?
Also, check the value of 'temp' variable inside the loop - add another TRACE, for example.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
For another operation (adding and filling one column)I use PopulateDontcares (BTW, it has to be the UPdate Batch function, and not update() in order for the routine to work). It adds a column and fills it with the values. That part works great!
I guess I'll go and look at my variables to see if any are at fault...and implement your sugestions.
Appreciate your help,
ns
|
|
|
|
|
hi..
compiler has error when I add OPENFILENAME in my code .where is the wrong?
|
|
|
|
|
|
yes..
(24)OPENFILENAME ofn;
EROORS:
20.cpp(24) : error C2065: 'OPENFILENAME' : undeclared identifier
20.cpp(24) : error C2146: syntax error : missing ';' before identifier 'ofn'
20.cpp(24) : error C2065: 'ofn' : undeclared identifier
|
|
|
|
|
If you want to keep WIN32_LEAN_AND_MEAN, include commdlg.h.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
|
no errors when I delete this
#define WIN32_LEAN_AND_MEA //in stdafx.h
|
|
|
|
|
Does anyone done an implementation of Layered Service Provider for Windows Sockets 2? Unfortuantely the only sample i've got (from MJN) doesn't work and the documentation isn't very clear.
|
|
|
|