|
I'm trying to use the ULONG_PTR type in my MFC app, but I'm getting the
error C2061: syntax error : identifier 'ULONG_PTR' compiler error message. I've had a look in MSDN and found 'Q255556', which suggests that I'm using the wrong basetsd.h, and that I should be using the one that comes with the platform SDK. I've had a look at my include directory (Tools | Options) and I've got C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE as the first directory, but still no joy with my ULONG_PTR.
Is C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE the platform SDK? And does anyone know what I need to do to be able to use ULONG_PTR?
Dylan
|
|
|
|
|
|
Dylan Kenneally wrote:
Is C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE the platform SDK? And does anyone know what I need to do to be able to use ULONG_PTR?
That is the copy of the SDK that comes with VC6 and is probably out of date. If you have the platform SDK installed it'll probably be more like
C:\Program Files\Microsoft SDK\Include
Michael
Wonder Woman, Wonder Woman.
All the world's waiting for you,
and the power you possess.
In your satin tights,
Fighting for your rights
And the old Red, White and Blue.
|
|
|
|
|
Please reply to victor.volkman@eds.com
Is there any way to compile part of a project with VC6 and part
of a project with VC7? We are suspecting a code generation bug
and it would help alot if we could pick and choose which source
files to compile with either compiler. Both compilers are
already installed and coexisting physically.
If we build an all-VC6 project and compile only a single file
with VC7, we get a linker error like this:
surf.lib(srferr.obj) : error LNK2019: unresolved external symbol "__declspec(dll
import) private: void __thiscall std::basic_string<char,struct std::char_traits<
char="">,class std::allocator<char> >::_Copy(unsigned int)" (__imp_?_Copy@?$basic_s
tring@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXI@Z) referenced in funct
ion _SurfsGetCloudNorms
surf.lib(srferr.obj) : error LNK2019: unresolved external symbol "__declspec(dll
import) void __cdecl std::_Xlen(void)" (__imp_?_Xlen@std@@YAXXZ) referenced in f
unction _SurfsGetCloudNorms
..\..\bin\iw\imageware.exe : fatal error LNK1120
|
|
|
|
|
i think the STL has changed enough between the two versions that you can't link .obj or .libs from one to the other.
-c
Be very, very careful what you put into that head, because you will never, ever get it out. --Thomas Cardinal Wolsey
|
|
|
|
|
victor.volkman@sdrc.com wrote:
Is there any way to compile part of a project with VC6 and part
of a project with VC7?
Yes, but almost exclusively if you use C linkage. Debug info, name mangling and especially the standard C++ library has changed enough to make it completely link-incompatible.
We are suspecting a code generation bug
Let me guess... Floating point code?
VC7 has quite a few documented bugs. You might want to search the archives for microsoft.public.vc.language to see if it's not something already known.
Another idea might be to tell the compiler to also generate assembly code (or even debugging in combined source/assembly) to see if the code generated is wrong or not.
++luck;
|
|
|
|
|
Anybody know how to work this thing? I have a project (an .exe) which calls a bunch of calculations that are performed in a .dll. I've got profiling working for the project, but it is only reporting info for functions declared in the .exe. I don't get any info for functions that are in the .dll.
Thanks in advance for any tips.
|
|
|
|
|
Hello!
Does anyone know about any sort of a utility program that can find and delete all the unused resources (bitmaps, dialogs, strings..) that have been left in the project, since everyone forgot about them?
Perhaps an add-in to the Visual Studio, or something...?
Thanks in advance!
|
|
|
|
|
|
nope, that not it, those only remove temporary files from disk ( .obj, ... )
but this[^] might help.
but I haven't found something yet that does the work; I usually take a few hours here and there browing the resource.h file and the .rc file to clean up unused resources.
Max.
|
|
|
|
|
Maximilien wrote:
nope, that not it
Yep, you're right, i mixed up two different problems.
I guess it's time to finally start the clean up of my last project resource files...
rechi
|
|
|
|
|
Thank you very much guys!
The prog you talked about is also quite useful, but as you said, it did not seem to solve the problem I had mentioned.
|
|
|
|
|
In the OnInitDialog I do a MoveWindow (top, left, width, height) if a certain flag is set. Otherwise the default positioning happens. How exactly does Windows decide where to spawn the CDialog by default from my MDI view class? It doesnt always show up automatically at the same place each time I start afresh.
Appreciate your help,
ns
|
|
|
|
|
Sorry it's me again...
In MDI project, how can i detect there is no child window(they are all closed).
because i want to Disable a combobox when there is no child window.
thx in advance.
|
|
|
|
|
jeremysay wrote:
Sorry it's me again.
Don't worry ... it's also me again
.. and it's only a try, but a call to MDIGetActive should return NULL if there aren't any open windows left.
|
|
|
|
|
Schlaubi wrote:
it's also me again
fortunately you are here !!!
so..it works perfectly
once again your solution IS the solution !!
thx !!
|
|
|
|
|
i have a thread that is going to keep attention to a variable, once something is changed in the variable it has to respond to it. So this is how my code looks now:
<br />
BOOL SomeVariable;<br />
<br />
UINT WatchThread(LPVOID param)<br />
{<br />
while (TRUE)<br />
{<br />
if (SomeVariable)<br />
{<br />
break;<br />
}<br />
}<br />
}<br />
<br />
.....<br />
<br />
AfxBeginThread(WatchThread, (LPVOID *)this, THREAD_PRIORITY_NORMAL);<br />
<br />
.....<br />
if i run this my program will need 100% processor usage. how can i prevent this? Make a Blocking function of "SomeVariable"? and how?
[]D [] []D []
|
|
|
|
|
I think you should perhaps insert a Sleep command inside your thread for not to consume so much processor power. Beside that, I don't know whether your thread-solution is the most practible one when waiting for a variable to change. Perhaps you could work with events and one of the wait functions (like WaitForSingleObject), setting the event when your computations have finished (take care: in that case your computation should be placed inside the thread because the wait function is blocking)
|
|
|
|
|
Spinning in a tight loop waiting for a variable to change is not the proper way to notify a thread to begin doing something. Read up on thread synchronization techniques; events and semaphores and the method WaitForSingleObject. If you must do it the way you've described, put a tiny sleep (Sleep(10)) in your while loop.
Ron Ward
|
|
|
|
|
the reason why i want it to be a blocking process is because i want to recreate the windows messaging device, so make my own messagelist. this list will be read by a procedure for the control of a database. i wanted to make the function that reads the messagelist like the function recv (for network communication), the function recv lockes up the while loop until it has received information.
i hope that something like this is possible...
[]D [] []D []
|
|
|
|
|
i don't really get what ur doing but maybe this is sort of what u are looking for?
UINT WatchThread(LPVOID param)
{
while(1){
myclass* pthis = (myclass*)param;
int nmsg = pthis->getMsg();
// do something here
}
}
int cmyclass::getMsg(){
::WaitForSingleObject( _event, INFINITE);
return _msgNumber;
}
void myclass::setMsg( int nmsg)
{
// lock a critical section or use whatever synchronization needed
_msgNumber = nmsg;
SetEvent( _event);
// unlock the critical section or whatever
}
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
There are several solutions. One solution is an event kernel object and WaitForSingleObject(). Use ::SetEvent() and ::ResetEvent() to signal the object.
Kuphryn
|
|
|
|
|
I would like to do a drag and drop from a file to my dialog window to have the path and the name of the file. How can I do that as simply as possible?
Thanks!
Beginner developer
|
|
|
|
|
Call DragAcceptFiles() in OnInitDialog.
Then implement OnDropFiles - to handle WM_DROPFILES messages - making calls to DragQueryFile and DragFinish as documented.
rechi
|
|
|
|
|
Thanks!
Do you have an example?
Thank you again!
|
|
|
|