|
hi,
To start with u can create a simple Dialog based application. You'll have to read MSDN for more information, for how to:Create a dialog based app". Then u can use Windows SDK funtions and MFC to do the rest. Like use CreateProcess / WinExec to open the .xls file. MFC provies a Find dialog class which is easy to use. Its very difficult to explain a step-by-step process. It would be better if u read MSDN on the said lines.
hope this helps,
Sharad Ganesh
|
|
|
|
|
Hi,
I want to get the path where the application is running...
The GetCurrentDirectory() (SDK function) is not what I want...
Thanks in advance...
Hello World!!!
from Raphaël
|
|
|
|
|
void TakePath(LPTSTR path, LPTSTR filename)<br />
{<br />
wcscpy(path,filename);<br />
TCHAR * p = path+wcslen(path);<br />
while(p>path){<br />
if(*p == '\\') break;<br />
p--;<br />
}<br />
*(++p) = '\0';<br />
}<br />
...<br />
TCHAR filename[121];<br />
GetModuleFileName(NULL, filename, 120);<br />
TakePath(path, filename);<br />
...
|
|
|
|
|
It would be better to use the system call to _splitpath:
char drive[_MAX_DRIVE] ;
char path[_MATH_PATH] ;
char filename[_MAX_FNAME] ;
char extension[_MAX_EXT] ;
source = "C:\some path\some_file.ext" ;
_splitpath(source, drive, path, filename, extension) ;
And if you don;t want a specific part of the split path, pass in NULL. For example, if you just needed the drive/path
_splitpath(source, drive, path, NULL, NULL) ;
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Thanks for this answer...
Hello World!!!
from Raphaël
|
|
|
|
|
Hi guys,
I am new bee in MFC. I have to get the System details where I am running my program, I use GetSystemInfo() call for that but I couldn't get the details of the OS. Is there any call to get that? Please help. thanks.
bye
Prav
|
|
|
|
|
Hi guys,
I am nee bee in MFC. I have to get the System details where I am running my program, I use GetSystemInfo() call for that but I couldn't get the details of the OS. Is there any call to get that? Please help. thanks.
bye
Prav
|
|
|
|
|
|
I need to assume that this person doesn't know how to use GetVersionEx. The following example retrieves the current version of Windows.
OSVERSIONINFO vi;
WORD wWinVer;
vi.dwOSVersionInfoSize=sizeof(vi);
GetVersionEx(&vi);
wWinVer=MAKEWORD(vi.dwMinorVersion,
vi.dwMajorVersion);
Besides the major and minor version numbers, the version information returned by GetVersionEx includes the build number of the OS, identifies the running platform, and contains additional information about the Windows version installed.
Peter O.
|
|
|
|
|
Hi,
Please look into the code and reply my question
char *ptrChar;
ptrChar= new ch;
*ptrChar = 'c';
''
'' some logic here
''
ptrChar = NULL;
when I tried to use delete ptrChar,application is getting crashed but if I assign it to NULL application is not crashing , is this correct way of coding
Can anyone please explain
Thanks
Uday
|
|
|
|
|
'ch' is an unspecified type. Please repost what your code really looks like.
|
|
|
|
|
|
you should do this:
char *ptrChar;
ptrChar= new char;
*ptrChar = 'c';
''
'' some logic here
''
delete ptrchar;
Best regards,
Alexandru Savescu
|
|
|
|
|
use
ptrChar = new char
then
delete ptrChar
You should always delete what you create with new .
Setting ptrChar to NULL after deleting is good practice if you may use ptrChar later.
Jason Henderson quasi-homepage articles "Like it or not, I'm right!"
|
|
|
|
|
hi,
Assigning a pointer to NULL does not actually free the allocated memory. Your memory should have been allocated by using "new char". ch is not any type here. I presume it should have been "char". One very nice thing about delete is that even if the pointer = NULL, ur app _won't_ crash.
I just replace that new ch with "new char". and then
delete ptrChar;
Regards,
Sharad Ganesh
|
|
|
|
|
hi,
memory is allocated using new but still when I am trying to delete, it is getting crashed
Uday
|
|
|
|
|
hi,
Did u check up on the corrected code i posted ? There was a corection "new char".
Rgds,
Sharad
|
|
|
|
|
I have a CScrollView derived class that displays a child dialog containing various settings. Normally, when I scroll the contents, the child dialog moves with it. I overrode the following function to make the child hover.
void CMDITestView::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if(m_hWnd&&m_lpCodeSettingsDlg!=NULL)
{
WINDOWPLACEMENT wndpl;
m_lpCodeSettingsDlg->GetWindowPlacement(&wndpl);
ClientToScreen(&wndpl.rcNormalPosition);
m_lpCodeSettingsDlg->ShowWindow(SW_HIDE);
CScrollView::OnVScroll(nSBCode, nPos, pScrollBar);
ScreenToClient(&wndpl.rcNormalPosition);
m_lpCodeSettingsDlg->SetWindowPlacement(&wndpl);
m_lpCodeSettingsDlg->ShowWindow(SW_SHOW);
}
}
With the ShowWindow calls it flickers when the child is redrawn, without it the window stretches when being redrawn, and it looks terrible.
Does anyone have any ideas about how to stop the flickering and/or stretching? The CMDITestView was created with WS_CLIPCHILDREN style.
Many thanks,
Alan Dugdall
|
|
|
|
|
I think you should override CMDITestView::OnEraseBkgnd. Instead of calling base class implementation, draw background yourself, excluding new dialog's area (see CDC::ExcludeClipRect), and return TRUE.
|
|
|
|
|
Thankyou very much. Works a treat now!
|
|
|
|
|
Can somebody show me how to list the dlls used by an executable file (the imports table)? I need to use the in a program of my own. I read some articles in MSDN about PE Header format, but I am more confused.
Please help me.
Thank you
Sorin
|
|
|
|
|
|
Thank you for the reply. What I need is a fragment of source code, because I have to integrate it in a software I am currently developing.
I anyone is willing to show me how to implement this (in C++), thank you very much.
Sorin
|
|
|
|
|
|
What is "best practice" for error handling and reporting within a called function in C++?
e.g. the function normally returns a DataSet but obviously when an internal error occurs, you want to return some kind of error description so that the caller can handle it gracefully. How do I then return that error description without causing problems as the function is expected to return a DataSet?
ta
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
The greatest thing you'll ever learn is just to love, and to be loved in return - Moulin Rouge
Alison Pentland wrote:
I now have an image of you in front of the mirror in the morning, wearing your knickers, socks and shoes trying to decided if they match!
|
|
|
|