|
I don't know if you are completely right. Certainly, you get an errormessage on an assignment in a header file. But in this case I wouldn't be amazed if the whole "extern"-statement is a problem, because his globalVar isn't "extern" in this case. I didn't try out. Anyhow, I wouldn't place an "extern"-statement in the stdafx.h, even because it is included everywhere else. But that's a question of the point of view.
MS
|
|
|
|
|
Another way of doing the same would be declare it static. So in the stdafx.h you can write like
static int gi_var = 0;
|
|
|
|
|
That wouldn't be a true global variable then. That makes n variables all with file scope.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
There is nothing wrong with declaring a variable extern and then defining it in the same compilation module.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hi,
I've created an mfc dialog-based app, and a menu-resource. But I'd like the menu to appear in the dialog (at the moment it isn't appearing). I know I have to call some kind of CWnd::*** function, but which?
In other words: I have a menu resource, and I want to use it by displaying the menu in the GUI!
This is the most simple kind of menu, but I can't show it
|
|
|
|
|
Put this code in you OnInitDiaog()
CMenu menu;
menu.LoadMenu(ID_OF_MENU);
SetMenu(&Menu);
menu.Detach();
DrawMenuBar();
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
Declare an object of CMenu in the CDialog derived class
CMenu m_Menu;
In the overridden OnInitDialog member function call -
m_Menu.LoadMenu(<menu ID>); //load menu.
SetMenu(&m_Menu); // set menu for the dialog window.
This should work.
|
|
|
|
|
Hi,
can anyone tell me how to get the list of all files
used by the user while he is logon on the system.
i.e i want to get the listing of all the files
accessed while he was log-on, how much time he has used each file. etc.
does any one have any idea. or a url of any project.
which give such facilities.
|
|
|
|
|
You'll need a file system driver that monitors file system device objects for IRPs and FastIO requests directed at the drives on your computer.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
i want to scan PCI slot which has how many sound card affixed in my computer using with visual C++ programming?
|
|
|
|
|
I HAVE DEVELOPED A PROGRAM WITH VISUAL BASIC SCRIPT, THIS PROGRAM WRITES A FILE CONTAINING SOME TEXT LINES, I CAN'T READ THIS FILE WITH C++ TECHNOLOGY. I THINK THAT THE PROBLE IS BECAUSE VBS WRITES UNICODE AND C++ READS ANSI.
CAN SOMEONE HELP ME AND SEND SOME EXAMPLE CODE?
THANKS.
VISUAL C++
|
|
|
|
|
Script code:
Dim fso
Dim file
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.CreateTextFile("c:\myfile.txt", true)
file.WriteLine("This is a line in my file")
file.Close
C++ (MFC) code:
CStdioFile file("c:\\myfile.txt", CFile::modeRead);
CString strLine;
file.ReadString(strLine);
file.Close();
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
hi..
i am useing Inno programe to build a setup file for vc++
application but when i extract the setup file in other computer (no Visual stdio is installed their )
an error message is came up when the installation is finised and lunch the program
it say:
the dynamic library MFC42D.DLL could not be found in the spacified path C:\Program Files\F.T.P;.;C:\WINNT\system32;C:\WINNT\system;C:\WINNT\system32;C:\WINNT;C:\WINNT\system32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN
i tried to build it again but invlued LIB directory of MFC folder in VS directory but it also did not work
So any help???????????????
|
|
|
|
|
You need to build ur application in Release mode before you disturbute ur application.. MFC42U.DLL is usally shiped with VS for debugging the code.
But MFC42.dll is shiped with the OS itself.
Still Alive!!!
Thank you God.
|
|
|
|
|
I'm sure it was only a typo, but MFC42U.DLL is the UNICODE version of MFC42.DLL, while MFC42D.DLL is the DEBUG build of MFC42.DLL, and cannot be shipped with your app, as it will break the license agreement for VC or Visual Studio
Steve S
|
|
|
|
|
Steve S wrote:
I'm sure it was only a typo
humm, he did say that MFC42D.dll is missing and not MFC42U.dll.
Still Alive!!!
Thank you God.
|
|
|
|
|
|
oke i rebuild my application in Release mode and use Inno
after in the add files option i add the MFC42U.DLL and
MFC42.dll from C:\WINNT but it also did not work and the generated program with different icon and olny welcome and goodby messages apears
|
|
|
|
|
Since you said that ur application showed some welcome message it means that the application worked but the logic of the application did not work. You need to cross check that some times the applications build in debug will work and in release it wount because of silly errors that in debug would not be an inssue but in release build it does, like assigning the pointer to null or initializing the member variables to default values while creating etc.
Still Alive!!!
Thank you God.
|
|
|
|
|
i dont that it was a mistake i made in the selection of exe file i did not select the right path so the problem still in the dll files ?
any help
|
|
|
|
|
i found this file vcredist.exe that may be what i need tryed to added to my Inno setup project but it still give
the same error so any one know how to work with Inno setup program or vcredist.exe
|
|
|
|
|
Hi all,
in list view, why does "CScrollBar *pscrl = GetScrollBarCtrl();" allway take NULL. Please help me ... I want the thumbnail of VERT allway end of list.
best regard,
Thanks all,
|
|
|
|
|
Did you enable the scrollbar in the resource editor, for the list view?
Still Alive!!!
Thank you God.
|
|
|
|
|
I think ListView in MDI but not list control
Thanks,
|
|
|
|
|
Opps sorry,
I guess the scroll bar is not always present, It comes up only when it is required, like when there are more data in the list that the screen can handle.
Still Alive!!!
Thank you God.
|
|
|
|