|
Sounds like a bug in vsprintf
It surely should take everything that is passed literally as literals.
Or I am missing something here?
Maybe it is a feature, called somewhat like "recursive format substitution"...
What happens if you replace "%" with "%%" in your data_name?
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Actually, it was a bug in our re-defined printf. The function for the richedit control that we were using was expecting both a format specifier and a va_list, but we forgot the format specifier. Thus, when the function saw
%recovered, it saw an invalid format specifier (%r) and threw out the % like it said it would.
I hate when compilers do what you tell them to do instead of doing what you want them to do.
Thanks for the help.
Shawn
|
|
|
|
|
Shawn Horton wrote:
I hate when compilers do what you tell them to do instead of doing what you want them to do.
Yeah... After 40 years of science, computers are still stupid at all. Tons of work remaining for us developer folks
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
I get this error when using acmDriverEnum to enumerate all the different codecs on my system, this is the callback function:
BOOL WINAPI listCallback(HACMDRIVERID hadid, DWORD dwInstance, DWORD fdwSupport)
{
if (fdwSupport & ACMDRIVERDETAILS_SUPPORTF_CODEC)
{
ACMDRIVERDETAILS details;
details.cbStruct = sizeof(details);
acmDriverDetails(hadid, &details, NULL);
SendMessage(GetDlgItem(ghWnd, IDC_CODECS), LB_INSERTSTRING, 0, (LPARAM)details.szLongName);
}
return true;
}
In this routine i simply check if the current driver is a codec, and if it is i add the name of it to a listbox. The error happens when i have looped though all of the different codecs and the return true; statement has been executed. After that it jumps to some assembly code, and this is the stament it gives me the message after completing:
call dword ptr [ebp+8]
When that statement has been executed, the "User breakpoint called from code at 0x77f9f9df" message appears, and it jumps to this statement:
int 3
I've never experienced this message before and i haven't got a clue what it means.
All help appreciated.
-Rune Svendsen
|
|
|
|
|
This is an exception being thrown... Try review the call stack and get some other clues...
Concussus surgo.
When struck I rise.
|
|
|
|
|
Sorry for my ignorance, but what is the call stack and how to i review it?
Thanks.
|
|
|
|
|
Try View/Debug Windows/Call Stack (or press Alt+7)
It's a debug window that shows all the functions called until your program got into that line the debugger is showing.
Concussus surgo.
When struck I rise.
|
|
|
|
|
umm, not sure if it makes much sense, but this is the contens of it when the message appears:
NTDLL! 77f9f9df()
NTDLL! 77fb4966()
NTDLL! 77fb3bdc()
NTDLL! 77fa7131()
NTDLL! 77fca4cb()
MSMS001! 01ac7b68()
MSMS001! 01ac7539()
MSMS001! 01abfcf7()
VCT3216! 01254326()
|
|
|
|
|
The message "User breakpoint called from code at 0x77f9f9df" means that a software interrupt 3 was thrown, which is used for breakpoints. An int 3 asm instruction is a so called "hardcoded breakpoint" and causes the message and halts the program in the debugger. In debug mode the compiler initializes any unused memory and also some bytes before and after every function with this instruction. This is a good thing, because it let you find jumps to invalid adresses, and obviously such an illegal jump is also your problem.
Okay, so much about the magic things in the background. What actually happens in your case is a bit difficult to figure out. I assume that the stack is not layed out as it should, therefore the app crashes while executing the return statement. Note: The return statement is only the position it crashes - the real problem is somewhere else and just not detected before.
Please do the following:
- What happens if you remove anything from your function, but the
return true statement? Is the problem still there? - Please show us the line you where you pass the callback function to acmDriverEnum(). Are you doing some ugly cast's there because otherwise it would not compile? Maybe your callback functions prototype is not layed out as it should. Casting it to the "correct type" is a typical source for big trouble, if you are not absolutely sure about what you are doing.
(I really do have a feeling that it is 2. that causes your problem - but hey, it's just a feeling )
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
1. I have tried removing everything from the callback function except return true; , and when i do that the messagebox doesn't appear, but in the Debug fan (the one where there's Build, Debug, Find In Files 1 etc.) it says
First-chance exception in MP3.exe (MSACM32.DLL): 0xC0000005: Access Violation.
First-chance exception in MP3.exe (MSACM32.DLL): 0xC0000005: Access Violation.
(yes, the statement is shown twice)
2. The line where i call the function that uses the callback function is as follows:
acmDriverEnum(listCallback, NULL, ACM_DRIVERENUMF_DISABLED);
The prototype of the callback is:
BOOL WINAPI listCallback (HACMDRIVERID hadid, DWORD dwInstance, DWORD fdwSupport); but that is actually not the original callback function definition, it's like this:
BOOL ACMDRIVERENUMCB acmDriverEnumCallback(HACMDRIVERID hadid, DWORD dwInstance, DWORD fdwSupport); the reason i changed it was that it wouldn't compile when i used ACMDRIVERENUMCB, a lot of compile errors showed. so i asked what could be wrong and one said that maby ACMDRIVERENUMCB was just a typedef of WINAPI so i used that, could that be where the problem lies?
Thanks for your help.
|
|
|
|
|
redeemer wrote:
the reason i changed it was that it wouldn't compile when i used ACMDRIVERENUMCB, a lot of compile errors showed. so i asked what could be wrong and one said that maby ACMDRIVERENUMCB was just a typedef of WINAPI so i used that, could that be where the problem lies?
I doubt it. (Maybe this is just because it was me who suggested you to change it . However, I never said is a typdef for WINAPI, but it is a typedef for the pointer to listCallback. Take a look at the definition of ACMDRIVERENUMCB in the header file. The docs are just wrong here.)
However, back to your problem: It works if you remove all code from your listCallback. Therefore it is probable (but not sure...) that the problem is caused by that code. (The exception messages you get are no problem. If the debugger does not claim about an unhandled exception they are catched inside MSACM32.DLL - nothing you should worry about.)
Next step: Trackle it down. If it fails because of that code, check which part of the code (especially the calls to acmDriverDetails() and/or SendMessage()) causes the problem. (Don't forget to pass a valid string in SendMessage() if you remove the call to acmDriverDetails()!)
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Hi!
I want to get the text of a button from another app.
Usually I use SendMessage with WM_GETTEXT to get the text. But this time it doesn't work because the button has a bitmap AND a caption.
Even Spy++ can't get the text of the button.
It seems like the caption is being drawn at runtime onto the button
Does anyone know a solution?
thanks in advance
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Sorry - there's nothing you can do about owner-drawn button which doesn't use Get/SetWindowText for its caption.
What kind of application are you developing?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
I simply want to find out what online status (Online, Invisible, Away, ...) ICQ currently has without utilizing the ICQAPI from Mirabilis. But I didn't find a way yet exept taking a look at the button which has the current status as its caption.
But it is owner drawn
modified 12-Sep-18 21:01pm.
|
|
|
|
|
1)How can i convert _variant_t to std::string ??
2)How can i convert _variant_t to char * ??
|
|
|
|
|
_variant_t v(_T("Test string"));
std:string s = (LPCTSTR)(_bstr_t)v;
printf(s.c_str()); // const char *
Concussus surgo.
When struck I rise.
|
|
|
|
|
Occasionally I need to send out debug versions of my apps - I keep hold of the EXE so when I receive a Dr Watson log, I can run the EXE, attach using MSDEV, break in and jump straight to the source of the problem. Also, I used to use a tool called BugTrapper that required you ship your app with debug info, etc. Anyway, I digress. The problem is that with one application, the debug EXE is ENORMOUS!
Here is how I created the project:
* First I used the MSDEV Build|Configurations option to create a new build called Release Unstripped which is based on the normal Release build.
* I then changed the project settings for the Release Unstripped build in just two places:
From the C/C++ tab, I set Debug Info to Program Database.
From the Link tab I enable Generate debug info.
When I then do a full build of the Release, Debug and Release Unstripped versions I get the following sized EXEs:
Release: 3MB
Debug: 9MB
Release Unstripped: 18MB
How the heck can the size difference be so huge?? What am I missing? There must be a project setting I have missed??
Immerse your soul in love.
|
|
|
|
|
Maybe you're statically linking to MFC and other libraries...
Concussus surgo.
When struck I rise.
|
|
|
|
|
I am statically linking with MFC for all builds - including the normal debug one. I don't see why my hybrid release/debug version should be double the size of the debug one. I have other statically linked apps that don't exhibit this problem, so there must be something I have missed in the project settings...
Faith. Believing in something you *know* isn't true.
|
|
|
|
|
Check the resulting executables with dumpbin.exe. At least you'll know what exactly causes the release unstripped to be that large.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
hello,
i want to convert texts to bitmaps. the text's font , size
and other font attributes will be given . the program will
convert the text to bitmap. please help me with necessary code and their explanation.
my e-mail address is
smshahed@yahoo.com
and
nejhum@bttb.net.bd
thank you ,
sm shahed nejhum
|
|
|
|
|
|
In windows you can close a dialog with the x-button on the top-right corner or you press alt-F4.
But, if you start a dialog based application, the dialog also closes when you press enter or escape (ok or cancel).
Can I disable this standard behaviour?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
override PreTranslateMessage
then add this code:
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
// Don't let CDialog process the Escape key.
if ((pMsg->message == WM_KEYDOWN) && ((pMsg->wParam == VK_ESCAPE) || (pMsg->wParam == VK_ENTER))
{
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
tnx, it works.
VK_ESCAPE is defined somewhere, but VK_ENTER isn't. any headerfile to include? or is it VK_RETURN?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|