|
I need to pass the macro __FUNCTION__ to a constructor (it's for error handling) but that macro will not work on any compiler.
What I want to know is if there is a way of knowing if the macro is avaiable with pre-processor directives. Something like:
#ifdef SOMETHING
MyConstructor( int );
#else
MyConstructor( void );
#endif
Where SOMETHING is only defined if __FUNCTION__ is avaiable. Is this possible? If not, is there any other way?
Thanks in advance
hint_54
|
|
|
|
|
hint_54 wrote: ...if __FUNCTION__ is avaiable.
Can't you just use:
#ifdef __FUNCTION__
...
#endif
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I dont know. I dont have the means to test it. My compiler (VS6) does not support the __FUNCTION__ macro. You think it will work?
regards
hint_54
|
|
|
|
|
|
What about the compilers that are not from microsoft?
regards
hint_54
|
|
|
|
|
|
true
hint_54
|
|
|
|
|
hi
i wana program in mfc that read from text file and do it an lexical analysis in compiler stage put the integer in list & key word in list & operation in list & real number in list & constant in list and punctuation in list
if any one can help send me email and i will send him the ER diagram
|
|
|
|
|
Hi,
i might misread you but if i'am right you would like to write some kind of lexical analysis in mfc, don't you?
Well i can't serve with an mfc lexical analysis but during my studies i had to program a compiler for a so called language pl/0, which is kind of a pascal dialect. My solution does a lexical & syntax analysis and even produces code for a small virtual machine. It is all written in C, but really straight forward and perhaps useful for you.
If this isn't exactly what you have been looking for, then just ignore my reply.
http://www.htw-dresden.de/~s7725/study/compiler/pl0_extended_s7725.tar.gz[^]
have a nice day
|
|
|
|
|
thanks alot but i wana program in mfc
i look to ur c++ program its very simple and good and thank you for attention
|
|
|
|
|
You may search in google for flex. flex is an open source generator for lexical analysis. It is written in C but als has a C++ version. Lats time I used it I had quite some trouble to get it compiled using VC++, but maybe its improved. It saves you al lot of work and you can easily integrate it in your code
|
|
|
|
|
if any body can receved the digram and do it for me in mfc ?
|
|
|
|
|
Hi all
Working on converting a 32-bit server application to a x64 executable for performance comparision, but there is something wrong with the application or it's settings and I'm beginning to run out of ideas.
The project runs great in 32-bit.
It's a C++ application that has dll-files which I personally compile in 64-bit, shouldn't be any other except systme files.
Checking dependencies and they should all be 64-bit according to Dependency Walker.
It compiles without problems, gives a few warnings but that's no big deal since they are all related to 32-64 bit conversion and none should be of any relevance to this problem.
But, when I try to run or debug the 64-bit version I immediately get an error, Unable to start application. "This application has failed because the application configuration is incorrect. Review the manifest file for possible
errors. Reinstalling the application may fix this problem." No matter how early in the app I set any breakpoint I can't reach it... yet it doesn't seem to be any regular link error. The application config is the same as for the 32-bit version except that necessary x64-settings are changed is VS2005 project settings.
I'm currently running out of ideas, trying to find any tips out on the net and if I don't find anything I'll probably have to start up the whole project from scratch again... although the code would still be written it's a small mess since I didn't create the project earlier and I'm not 100% sure of all the project settings.
If anyone can confirm that these things shouldn't have anything to do with the problem I would be happy, or even better if you have any great tip for me:
The project was previously setup in VS2003 and VS2005_BETA, now I'm running VS2005 Pro
I'm currently running it through Terminal Server on a x64 Server 2003, using a regular WinXP as workstation to connect with.
As I said, I really do appreciate any tips.
TIA
-- modified at 4:22 Wednesday 5th April, 2006
|
|
|
|
|
hi everybody
am implementing drag and drop in i dialog that contains shapes drawn on it.
am doing it the ole way, am handling the WM_LBUTTONDOWN message to start the drag and drop operation
also am handling the WM_LBUTTONUP to stop dragging
the problem is that when i click first time on the dialog i get in the drag mode but the mouse up code is not called
the next click it is called
the next time it is not
and so on..........
thanks alot
|
|
|
|
|
Hi,
I am creating a setup project in Visual Studio. Apart form installation, I also want to run a batch file during setup. How do I do that?
Thanks in advance.
|
|
|
|
|
Manu_81 wrote: I also want to run a batch file...
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi there,
I'm using some CDialogBars in my Application. If they are floating and I click the close-button the controls on the bar disappear. But the window containing the bar remains on screen.
It disappears only when dragging the empty window on a position where it could dock.
Using exactly the same dialogbar in an example application worked fine.
Does anyone have an idea why it behaves like this?
|
|
|
|
|
I am trying to disable some menu items in a menu. I am successful in getting the menu items disabled using the function SetMenuItemInfo; but when the menu refreshes the items are re-enabled and I don't want that. Is there anything that I can do to disable menu items from refresh or recreate of the menu?
thanks,
|
|
|
|
|
jonesap5 wrote: ...but when the menu refreshes the items are re-enabled...
During the refresh, are you calling SetMenuItemInfo() or EnableMenuItem() ?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
What happens is I select submenu item from the 'Tool' Menu and it refreshes or recreates the main menu. At that point the sub menu items I disabled in the 'File' Menu are re-enabled. Does that make sense?
|
|
|
|
|
|
I am not using MFC, I am actually using a Win32 project.
|
|
|
|
|
i have a thread that calls the following
CoInitializeEx()
CoInitializeSecurity()
CoCreateInstance()
ConnectServer()
if the thread isnt successful in 3secs (using WaitForSingleObject(pThread->m_hThread, 3000)) it is closed.
what is the best way of killing a thread from outside the thread, i am using TerminateThread() but i dont think this is the best way??
it appears thou that the calls in the thread are not being killed off because if i go to start the thread again CoInitializeSecurity() throws up an error saying that it cant initialize security. so iam assuming it is saying this because the thread wasnt killed off right
plz help
|
|
|
|
|
viperlogic wrote: what is the best way of killing a thread from outside the thread, i am using TerminateThread() but i dont think this is the best way??
Set a boolean varible depending on it state terminate the thread
|
|
|
|
|
what command do i use to kill the thread thou from outside the thread?
|
|
|
|