|
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?
|
|
|
|
|
viperlogic wrote: what command do i use to kill the thread thou from outside the thread?
same, change the value of boolean variable from outside, which thread is checking from inside...
|
|
|
|
|
sorry, i dont understand, example please
thanks
|
|
|
|
|
viperlogic wrote: what is the best way of killing a thread from outside the thread...
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
|
|
|
|
|
so i use the following to delete a thread from outside?? Does "delete pThread" call ExitThread??
switch(WaitForSingleObject(pThread->m_hThread, 3000))
{
case WAIT_TIMEOUT:
{
delete pThread;
break;
}
case WAIT_OBJECT_0:
{
// thread has terminated on its own
break;
}
}
|
|
|
|
|
viperlogic wrote: Does "delete pThread" call ExitThread??
No. At the point in which you are deleting pThread , the thread has already terminated. You are just cleaning up the CWinThread object.
ExitThread() is called from within the secondary thread, unlike TerminateThread() which is called from outside the secondary thread.
"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 think i have that working now.
A kind of related problem i have is with the code below. This is a part of the code the thread executes, if sucessful all is ok. this thread has a timeout of 3secs. A problem is that the ConnectServer call below takes 2minutes to complete if it cant connect. when this happens the below messagebox pops ups and then the program crashes. is it crashing because the code wants to "return" but there is nothing to return to as the thread has been already killed?? How can i modify it so that it wont crash. A message box doesnt have to be displayed either.
many thanks
<br />
hres = pLoc_test->ConnectServer(<br />
_bstr_t(L"\\\\"+strIP1+"\\root\\cimv2"),
NULL,
NULL,
0,
WBEM_FLAG_CONNECT_USE_MAX_WAIT,
0,
0,
&pSvc_test
);<br />
<br />
<br />
if (FAILED(hres))<br />
{<br />
char error_msg[64];<br />
sprintf(error_msg, "wmi_test: Could not connect. Error code = 0x%x", hres);<br />
MessageBox(error_msg , "Error" , MB_ICONERROR | MB_OK);<br />
<br />
pLoc_test->Release(); <br />
return; <br />
}<br />
|
|
|
|
|
Since you are using WBEM_FLAG_CONNECT_USE_MAX_WAIT , why not set your WaitForSingleObject() call to also wait for 2 minutes (or a little more)?
"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
|
|
|
|