|
You have to update your header files by getting a newer version of the platform SDK. ULONG_PTR is a typedef of unsigned long and is declared in the file BaseTsd.h The oldest file I have it in came in the February 2001 PSDK, which is also the first PSDK that included GDI+ IIRC.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
hi Arends,
i download the new version of platform SDK.
and i include those files in my tools->options->directory
as C:\program files\Microsoft SDK\Include
but now also it get some errors
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(32) : error C2065: 'ULONG_PTR' : undeclared identifier
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(32) : error C2065: 'token' : undeclared identifier
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(32) : error C2165: 'left-side modifier' : cannot modify pointers to data
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(32) : error C2071: 'NotificationHookProc' : illegal storage class
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(33) : error C2146: syntax error : missing ')' before identifier 'token'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(33) : error C2165: 'left-side modifier' : cannot modify pointers to data
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(33) : error C2071: 'NotificationUnhookProc' : illegal storage class
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(33) : error C2059: syntax error : ')'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(86) : error C2059: syntax error : 'const'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(95) : error C2146: syntax error : missing ')' before identifier 'token'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(95) : warning C4229: anachronism used : modifiers on data are ignored
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(95) : error C2182: 'GdiplusShutdown' : illegal use of type 'void'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(95) : error C2059: syntax error : ')'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusFlat.h(2639) : warning C4229: anachronism used : modifiers on data are ignored
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusFlat.h(2639) : error C2440: 'initializing' : cannot convert from 'int' to 'enum Gdiplus::Status'
Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusFlat.h(2644) : error C2146: syntax error : missing ')' before identifier 'token'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusFlat.h(2644) : warning C4229: anachronism used : modifiers on data are ignored
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusFlat.h(2644) : error C2182: 'GdiplusNotificationUnhook' : illegal use of type 'void'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusFlat.h(2644) : error C2059: syntax error : ')'
reply early
send reply
|
|
|
|
|
maharaja pandian wrote: 'ULONG_PTR' : undeclared identifier
maharaja pandian wrote: i download the new version of platform SDK.
and i include those files in my tools->options->directory
as C:\program files\Microsoft SDK\Include
The fact that ULONG_PTR is undeclared is your first clue. It means that your compiler is still using the old version of BaseTsd.h. What you have to do is move the PSDK include directory to the top of the list of directories. You probably added it to the bottom of the list. The compiler searches the directories listed from the top to the bottom.
Do the same with the lib files, you do not want your program linking to the old lib files.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hi there,
I am using a code in VC++ (Console Win32 Application) used to connect to MYSQL. This was a successful attempt So what I think is no problem with library includes but as I tried the same code with MFC (Dialog based Application ) it returned the following linker errors:
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_query@8
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_close@4
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_free_result@4
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_num_rows@4
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_fetch_row@4
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_num_fields@4
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_fetch_field@4
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_store_result@4
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_select_db@8
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_real_connect@32
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_init@4
Debug/Job_Scheduler.exe : fatal error LNK1120: 11 unresolved externals
Error executing link.exe.
Please help me in this regard as soon as possible.
Best Regards
Asif Rogers
|
|
|
|
|
Have you added the LibMySQL.lib file to your list of libraries to be linked to your project? Try placing this in your file:
#include "MySql.h"
#pragma comment(lib, "LibMySQL.lib") It's been a while since I have played with MySQL, so I may be off base here.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I'm novice at GDI programming.
I've been working on the program which caputres the screen and saves it as a Jpeg image.
I made it. However It is really inefficient, I thought.
here is my work flow.
1. Get compatible screen DC.
2. Get compatible bitmap on it.
3. Write Bmp header and body using bitmap above.
4. Convert the bmp to Jpeg.
5. Delete bmp file.
What I mostly want to know is..
Should I make bmp file to get Jpeg image?
Could you recommend better way?
thanks.
|
|
|
|
|
consider using GDI+ there are many tutorials here in CP
-prakash
|
|
|
|
|
When we create multiple desktops using CreateDesktop, I want to hook the the Start->LogOff button and shutdown the desktops gracefully rather than logging out. Any idea how we can hook the Logoff button?
thanks!
|
|
|
|
|
Does the SetEvent function queue events? For example, if I signal the event 10 times in a row, will a waiting thread wakeup from a waitforsingleobject 10 times? The event is setup as automatic.
Thanks in Advance...
|
|
|
|
|
No the thread will wakeup in the first time itself. the significance of a singal is in waiting state only.
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
No, SetEvent just sets the event to the signalled state, so the number of times you call SetEvent doesn't matter.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Try a semaphore if this is the desired behavior.
Bob Ciora
|
|
|
|
|
Thanks - Semaphore works great. Thanks for the info... Regards.
|
|
|
|
|
I have a set of menus in MyFrame, and for some reason I move the
ON_COMMAND()
ON_UPDATE_COMMAND_UI()
of one of them to another module. The problem is its menu item is automatically enabled initially. All the other menu item's message map local to the MyFrame are disabled. How can the previous menu item be disabled?
Here's what MSDN says about update handler
If the framework does not find an ON_UPDATE_COMMAND_UI entry during command routing, it automatically enables the user-interface object if there is an ON_COMMAND entry somewhere with the same command ID. Otherwise, it disables the user-interface object. Therefore, to ensure that a user-interface object is enabled, supply a handler for the command the object generates or supply an update handler for it.
It is possible to disable the default disabling of user-interface objects. For more information, see the m_bAutoMenuEnable member of class CFrameWnd.
So I guess initially the Framwork doesn't find the specific ON_UPDATE_COMMAND_UI macro in MyFrame, that menu item was enabled. And I tried m_bAutoMenuEnable, that doen't work either.
|
|
|
|
|
Hi,
How can I show a WMF file in a non-mfc application?
I need to handle the zooming also.
Thank you.
- NS -
|
|
|
|
|
The tooltips of slider control is the current positon if you set the "Tooltips" property True. How can I set a special tooltips of a slider control? Just like "The current positon: 13". Thank you!
There are innumerable stars in the sky, the smallest is me!
|
|
|
|
|
Hello,
I've created a subclass of the Button class and I can't figure out why my OnPaintBackground method never gets called. Have any of you ever encountered this problem?
Gus
|
|
|
|
|
I figured it out:
this->SetStyle(ControlStyles::Opaque, false);
Just FYI...
Gus
|
|
|
|
|
I know XML Docs are supported for C# is VS.NET but what about C++? If XML Docs aren't supported natively for C++, has anyone come out with an add-on that implements them?
Todd Smith
|
|
|
|
|
Let say I've written a MMO server. Then I write a small C++ class called Bot that emulates a typical client session. Next I write a small test harness which can launch instances of Bots in separate threads.
The questions is how can I determine the max viable number of bot threads for a given machine? Every machine will have a different CPU/RAM configuartion etc. Can I determine at run-time how many bot threads to launch? I've tested my app with 500 bots and it works fine. I crank it up to 1000 bots and my system comes to a crawl.
Todd Smith
|
|
|
|
|
good afternoon, could anyone see where is the leak from? thank you! I've checked the momory allocation, the leak is happening around here:
strcpy( FileName, BinPath );
strcat( FileName, "CALLSM" );
strcat( FileName, Cycle);
strcat( FileName, ".BIN" );
if ( _access ( FileName, 0 ) != 0 )
{
sprintf( ErrorText, "File does not exist -> %s", FileName );
Message( ErrorText, VD_ERROR );
return 0;
}
m_information_line = "Loading CALLSUM Binary File.";
PostUpdate();
CallSumBin = new CALLSUM_BIN( FileName );
if ( !CallSumBin )
{
Message( "Unable to allocate CallSumBin binfile.", VD_ERROR );
return 0;
}
here is the delete in closedown() function:
if ( CallSumBin )
{
if ( !IsStop() ) {
strcpy( FileName, BinPath );
strcat( FileName, "CALLSM" );
strcat( FileName, Cycle);
strcat( FileName, ".BIN" );
m_information_line = "Saving updated CALLSM binary file";
PostUpdate();
CallSumBin->Save( FileName );
fprintf( Report,"Updated CALLSM binary file saved.\r\n" );
}
delete CallSumBin;
}
m_information_line = " ";
PostUpdate();
-- modified at 17:23 Wednesday 2nd November, 2005
|
|
|
|
|
valerie99 wrote: strcpy( FileName, BinPath );
Where is Filename allocated ? Is it ever deleted ?
C style string handling is a messy pile of crap, and the perfect way to get memory leaks. Why are you not using C++ here ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
As far as I can see, the memory leak must be in the CALLSUM_BIN class.
|
|
|
|
|
i don't see any here...
you CallSumBin = new CALLSUM_BIN( FileName ); and always delete CallSumBin; it then...
so, you might have a look at the CALLSUM_BIN constructor... does it allocate some memory that is not deleted (at the end of the constructor or in the destructor ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 3:18 Thursday 3rd November, 2005
|
|
|
|
|
Is your code perhaps calling the function containing
CallSumBin = new CALLSUM_BIN( FileName );
more than once without having called the closedown() function?
If so, that will cause a memory leak. I would suggest the following:
if ( _access ( FileName, 0 ) != 0 )<br />
{<br />
sprintf( ErrorText, "File does not exist -> %s", FileName );<br />
Message( ErrorText, VD_ERROR );<br />
return 0;<br />
}<br />
m_information_line = "Loading CALLSUM Binary File.";<br />
PostUpdate();<br />
if (CallSumBin != NULL)<br />
{<br />
delete CallSumBin;<br />
CallSumBin = NULL;<br />
}<br />
CallSumBin = new CALLSUM_BIN( FileName );<br />
if ( !CallSumBin )<br />
{<br />
Message( "Unable to allocate CallSumBin binfile.", VD_ERROR );<br />
return 0;<br />
}
Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|