|
Due to the possibility of virus attack on 26th April last week, we changed the dates of all computers in our office LAN. And on 27th when the danger is over, we restored back the correct dates and times.
Since then we are having trouble on computers where Visual C++ 6.0 is installed. Problem is that whenever someone makes a slight change in *.h or *.cpp file of his project, Visual C++ starts rebuilding the entire project again. And after successful rebuilding, when we try to run the program, Visual C++ IDE again asks us that some files need recompilation
This problem is really irritating because for just a small change in a file, the entire project is getting rebuilt by the IDE. We tried everything, we deleted all the compiler generated temp files, program database e.t.c but nothing is working for us. This problem is present on every computer on out network where VC++ 6.0 is present. Any one wants to give advice ???
|
|
|
|
|
This may be a dumb question, but did you also delete the .obj files?
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
but did you also delete the .obj files?
Yes i deleted all the files. The ones left were *.h, *.cpp, *.dsp, *.dsw
|
|
|
|
|
maybe the virus messed up the 'modified date' attribute of the files ..
|
|
|
|
|
Do any of the files still have a future date? This happened to me just yesterday. Someone from another TZ ahead of mine sent me some files. Some of the files were dated several hours ahead of my current time. Everytime I went to run the program, I was asked if I wanted to rebuild it. I finally went to the folder to find what file was dated in the future, opened it up, made a change, and re-saved the file. Problem solved.
|
|
|
|
|
I hope you backed up the your work space (.dsw and .dsp files at the very leasted).
If your company [or you} was realy worried obout the virus attack then some-one should have asked the administrator for a daily backup (of your projects files).
The statement "of his project file" sounds like you all are using different project files.
Check the date (and time) of all your files.
Have every one involded with the project recompile thier portion of the project. If the problem does not go away after that then you better (ask the administator to) scan the server.
Trust in the code Luke. Yea right!
|
|
|
|
|
Hi
I want to be able to check wheither the program is already running, so i don't want the program getting executed more then 1 time. The user should only get 'the second or more times he tries' a messagebox or some information that the program is already running on the system and has to be shutdown first to be ran.
Greetings
Jens
|
|
|
|
|
|
yeah seems like that class was exactly what i was looking for.
Thanks Rage!
And btw, do you happen to know a class which can return the current CPU id. I need that id to implement some security. (don't like this method of working though )
Greetings
Jens
|
|
|
|
|
JensB wrote:
yeah seems like that class was exactly what i was looking for.
If you need it, try and download it from PJ's website directly, I think the version is updated.
JensB wrote:
And btw, do you happen to know a class which can return the current CPU id. I need that id to implement some security. (don't like this method of working though
Maybe you could use GetSystemInformation.
Quoted from MSDN :
The GetSystemInfo function returns information about the current system.
VOID GetSystemInfo(
LPSYSTEM_INFO lpSystemInfo
);
typedef struct _SYSTEM_INFO {
union {
DWORD dwOemId;
struct {
WORD wProcessorArchitecture;
WORD wReserved;
};
};
DWORD dwPageSize;
LPVOID lpMinimumApplicationAddress;
LPVOID lpMaximumApplicationAddress;
DWORD dwActiveProcessorMask;
DWORD dwNumberOfProcessors;
DWORD dwProcessorType;
DWORD dwAllocationGranularity;
WORD wProcessorLevel;
WORD wProcessorRevision;
} SYSTEM_INFO;
Check it out directly in the MSDN for more info about the struct members.
Hope this helps.
~RaGE();
|
|
|
|
|
ok i will check it out directly @ msdn
I've downloaded the latest CSingleInstance v1.12 and implemented it on a new mdi application and it worked great.
BUT
When i try to implement it to my existing application, it doesn't work
i'll paste the appnameApp::InitInstance here:
CFile f;
SetRegistryKey("Company");
SetDialogBkColor(); // set dialog background color to gray
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
AddDocTemplate(new CSingleDocTemplate(IDR_MAINFRAME,
RUNTIME_CLASS(CMyAppNameDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CMyAppNameView)));
int iNrOfDialog = 1;
BOOL bGoOn=TRUE;
CDialog *pDialog;
int pushed;
m_bFromMain = false;
while (bGoOn)
{
switch (iNrOfDialog){
case 1:
{
pDialog = new CDlgWelcome2();
pDialog->DoModal();
delete pDialog;
pDialog = new CDlgWelcome();
pDialog->DoModal();
delete pDialog;
pDialog = new CDLogon();
pushed = pDialog->DoModal();
switch (pushed)
{
case (NEXT):
iNrOfDialog++;
break;
case (EXIT):
bGoOn = FALSE;
b_mExit = true;
break
}
delete pDialog;
break;
}
case 2:
{
pDialog = new CDlgList();
pushed = pDialog->DoModal();
....
so this code i don't have:
CMainFrame* pMainFrame = new CMainFrame;
m_pMainWnd = pMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
I've pasted the following code:
CInstanceChecker instanceChecker;
if (instanceChecker.PreviousInstanceRunning())
{
AfxMessageBox(_T("Previous version detected, will now restore it"), MB_OK);
instanceChecker.ActivatePreviousInstance();
return FALSE;
}
That i have put totally in the beginning of InitInstance.
And then before i go into the while repeating:
instanceChecker.TrackFirstInstanceRunning();
When i execute the program (use vc5) it gives an error on the line when i call the 'trackfirstinstanceRunning()'.
debug assertion failed:
sinstance.cpp
line: 145
What is on line 145:
ASSERT(AfxGetMainWnd() != NULL); //Did you forget to set up the mainfrm in InitInstance ?
I don't yet have a mainfrm, but a welcome form + logon form.
When can i know when the mainfrm is setup?
Any ideas?
|
|
|
|
|
ah sorry
i have put the trackfirstinstancerunning() at the end of InitInstance and now it works great (because then you have a mainwindow)
Anyway, thanks for the article
|
|
|
|
|
Here is another solution.
|
|
|
|
|
Is anyone who knows how to obtain a path to the folder in which there are dial up entries defined.
Please help
|
|
|
|
|
Why do you need a path to the folder? Can't you just use the Rasxxx() functions directly?
Here is an example of enumerating the RAS entries:
lpRasEntryName = (LPRASENTRYNAME)GlobalAlloc(GPTR, sizeof(RASENTRYNAME));
lpRasEntryName->dwSize = sizeof(RASENTRYNAME);
nRet = RasEnumEntries(NULL, NULL, lpRasEntryName, &cb, &cEntries);
if (ERROR_BUFFER_TOO_SMALL == nRet)
{
lpRasEntryName = (LPRASENTRYNAME)GlobalAlloc(GPTR, cb);
lpRasEntryName->dwSize = sizeof(RASENTRYNAME);
}
nRet = RasEnumEntries(NULL, NULL, lpRasEntryName, &cb, &cEntries);
if (nRet != ERROR_SUCCESS)
{
TRACE("RasEnumEntries failed: Error %d\n", nRet);
}
else
{
TRACE("Phone-book entries in the default phone book:\n\n");
for(i = 0; i < cEntries; i++)
{
TRACE("%s\n", lpRasEntryName->szEntryName);
lpRasEntryName++;
}
}
|
|
|
|
|
LPITEMIDLIST pidlDialUp;
LPSHELLFOLDER pDesktop,
pDialUp;
LPITEMIDLIST pidlTarget,
pidlTemp,
pidlDialUp;
LPENUMIDLIST pEnum;
DWORD dwRetrieved;
char szTemp[MAX_PATH];
HRESULT hr;
if(FAILED(SHGetDesktopFolder(&pDesktop)))
return NULL;
pidlDialUp = GetDialUpNetworkingPidl(pDesktop);
a piece of GetDialUpNetworkingPidl...
if(!pDesktop)
return NULL;
//get the pidl for Dial-Up Networking
hr = pDesktop->ParseDisplayName( NULL,
NULL,
L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{992CFFA0-F557-101A-88EC-00DD010CCC48}",
NULL,
&pidlDialUp,
NULL);
This is the ParseDisplayName from windows 98, and I have no clue how the name for dialupnetowking directory look under windows 2000
I need it for creating a shortcut on the desktop programmataticly.
|
|
|
|
|
|
I have one C++ dll with exported functions. But I dont have any details about the function's signatures.Is it possible to find out the same?
Vikram
|
|
|
|
|
No, not without the headers. if the exported functions end with @0 they take no parameters, @4 for 1 parameter, @8 for two parameters and so on. But I guess this won't help you much.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanx for the reply Grag,
Is it possible, by going inside the PE File structure or some another way of reverse engg?
|
|
|
|
|
Which is what Depends.exe does, but it still does not show you the function's signature.
|
|
|
|
|
Hi,
You can use the dependency walker to see the signatures.
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Why do you want or need the export signatures?
Trust in the code Luke. Yea right!
|
|
|
|
|
In order to make use of them, you need to know the return type and the parameter list. Normally, a .H file would provide this, but if you don't have that, other methods must be employed.
|
|
|
|
|
:(Your correct, of cource. I should have realised there was no header file(s) available. I do remember a project, someone submitted some where (possibly here), that took a .DLL and generated the needed files .h and .lib.
Trust in the code Luke. Yea right!
|
|
|
|