|
Try to call SetErrorMode with SEM_FAILCRITICALERRORS flag. It works with floppies, probably will with CD drive as well.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
thanks so much... this is perfect..
and to make it normal again after my check I just call
SetErrorMode(0);
|
|
|
|
|
Not exactly. SetErrorMode(0) returns the current error mode - I don't know why that behavior has been removed from MSDN. So the correct way is:
UINT uOldMode = SetErrorMode(0);
SetErrorMode ( uOldMode | SEM_FAILCRITICALERRORS );
SetErrorMode ( uOldMode ); And no I don't know why they didn't just provide a GetErrorMode() API.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Mike. Your knowledge always astounds me. No wonder your a MVP.
Regards,
Brian Dela
|
|
|
|
|
Thanks, Brian, but I don't think that was me on the awards list. I don't exactly have a unique name, and no one's ever contacted me in email about it.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Michael Dunn wrote:
but I don't think that was me on the awards list.
Well it should have been you. Is there anyway you could find out if it was?
Regards,
Brian Dela
|
|
|
|
|
does someone know a good Unicode Resource Editor ?
Thanks
Olivier
|
|
|
|
|
ummmmm huh?
for text? u mean foreign languages? or what?
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" biz stuff about me
|
|
|
|
|
well I have Translated a rc file into japanese.
The problem is that the width of some resource is too small. So I have to resize it and I would like to do it "graphically" with an editor and not directly into the rc file by changing it, compiling it and then to see it in my software ....
|
|
|
|
|
AFAIK, the resource editor works in code page, and is not in UNICODE;meaning, you have to be in the japanese code page to be able to edit the japanese resources.
go to the regional settings, and change to japanese ( don't remember which one it is ).
Max.
|
|
|
|
|
When the app first starts and you right click the area, the popup menu shows up. However if you start the app, do some other operations and then right click in the area , theres no popup menu!
Appreciate your help,
ns
|
|
|
|
|
Put the breakpoint in the right-click handler, check if menu loads correctly from resources 2nd time.
IMHO, this is just another symptom of the bug you've described below.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
Hello,
Does anybody know if it is possible to generate a header file from a .lib file?
The header file will contain the actual procedure with a call to GetProcAddress.
It should be really cool if I can specify just a set of procedures I need.
The reason why I ask this is the following:
I'm writing a program which connects to an Oracle database. Oracle delivers a .lib file.
The problem is that Oracle like to change the names of the client dll file from version to version.
So if I link the .lib file, the program will complain about missing dll's if I run the program with another version of the Oracle client than the one I compiled my program with.
All the procedures however are the same.
So it would be nice that I have a header file that translates some functions to their respective GetProcAddresses, and I should need to write the LoadLibrary part.
Thank in advance
Wim
|
|
|
|
|
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
|
|
|
|