|
When i browse for file, after selecting i got Microsoft, error which popups one dialog box which send, dont send, debug buttons, when i tried to debug i got unhandled exception error
|
|
|
|
|
How to declare CFileDialog?
|
|
|
|
|
CFileDialog thinly wraps the windows file dialog control. Nearly every app I've seen uses it's
functionality or extends it.
It's got alot of settings, including how you give it a list of file types to browse for.
WELL documented!
|
|
|
|
|
Instead of finding other crazy solutions, why don't you simply debug your program ?
If you are stuck (after using your debugger to locate the problem), you can still post some relevant code here, with a detailed explanation, so that we can help you.
|
|
|
|
|
When i debug the application i got unhandled exception error msg
my code for browsing files is..
static TCHAR BASED_CODE szFilter[] = "Windows Setup file (*.exe; *.EXE; *.msi ;*.MSI)|*.exe ;*.EXE;*.msi;*.MSI||";
CFileDialog oFileDlg(TRUE,"exe","",OFN_FILEMUSTEXIST|OFN_NOCHANGEDIR, szFilter);
oFileDlg.m_ofn.lpstrTitle = "Select the Installable Application";
if(oFileDlg.DoModal() == IDOK)
{
m_strSetup = oFileDlg.GetPathName();
GetDlgItem(IDC_SETUP)->SetWindowText(m_strSetup);
}
Now can u help me
|
|
|
|
|
So, it has nothing to do with the File Dialog. Did you check with the debugger what was returned by GetDlgITem(IDC_SETUP) ? And also what was contained in m_strSetup ?
Chances are that you have a memory violation (that would be nice to explain what you get when you have an exception), probably because GetDlgItem(IDC_SETUP) returns NULL.
|
|
|
|
|
kiranin wrote: GetDlgItem(IDC_SETUP)->SetWindowText(m_strSetup);//
Does the IDC_SETUP control exist at this point? Step into the code using the debugger.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Are you sure IDC_SETUP is a valid control?
|
|
|
|
|
The "crash" doesn't mean you are using the wrong function, it just means you are using it incorrectly.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
AfxGetMainWnd()->SendMessage(WM_COMMAND, SetCursorPos(r.x,r.y))
The above code works fine
but
CPoint r;
AfxGetMainWnd()->SendMessage(WM_COMMAND, SetCaretPos(r));
doesn't work since SetCaretPos is a void function.
so how do I sendmessage for SetCaretPos(r)
Thanks
Prithaa
|
|
|
|
|
Those aren't messages they are APIs - part of Windows.
Call them directly anywhere:
SetCursorPos(r.x,r.y);
That's it.
Read up on the caret....it's a little more involved. There's only one caret for the system.
|
|
|
|
|
SetCaretPos and SetCursorPos are functions you dont need to use SendMessage
|
|
|
|
|
Hi,
Thanks for the reply
I realised my mistake.
Prithaa
|
|
|
|
|
|
hai,
i have one maintance project from that .my role is ..i have to ..modify the bugs..
in which VC++ and VB are used.
now my problem is how can i debug both VC++ and VB.
plzz send me procedure..
sivaprasad
|
|
|
|
|
sivaprasadroy wrote: now my problem is how can i debug both VC++ and VB
Can you be more specific
|
|
|
|
|
I think you meant "fix the bugs" instead of "modify the bugs", right?
Anyway, this is a longshot...
Are you trying to debug C++ ActiveX controls used in a VB6 project?
If so, in VC6, load up your ActiveX control project. Click on Project->Settings, click on the Debug tab. There's a field called "Executable for debug session:". Point it to your vb6.exe, and change the "Program Arguments" to your vb6 project. Then you should be able to debug your activex control (breakpoints, etc).
I think this used to work, it's been awhile.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Exactly ... but iwill try what ur sended procedure
thanks a lot
Mr.S
sivaprasad
|
|
|
|
|
I have been doing an SDI application.I want to add an item (name of the application) to the shell context menu so that,the name of the application appears in the shell context menu when we right click on any file or folder and when i select that item the particular file or folder should be added to the application.When the application is closed that item should be deleted from the shell context menu automatically.How can i do this.
Thanks.
|
|
|
|
|
|
|
Till the last day I belived that the global variables gets initialized automatically. But last day while debugging, I found out that the application start from the WinMainCRTStartup() function. And then stepping through that function, I came accross a function like this.
<br />
_initterm( __xc_a, __xc_z );
Then I understood that it is inside this function the global variables get initialized. That means the gloabl variable are explicity been initialized.
Can any one tell me whats this __xc_a and __xc_z variables are? And how the _initterm is doing the initialization?
nave
|
|
|
|
|
It looks like __xc_a and __xc_z are arrays of function pointers - pointing to initialization
functions.
_initterm() loops through calling each function in __xc_a ... ?
It's in the runtime source code - see
crt0dat.c for _initterm()
cinitexe.c for __xc_a and __xc_z
crtexe.c for the xxxCRTStartup functions
Mark
|
|
|
|
|
|
problem about font
i write CMFont class,it inheritance CFont
e.g:
class CMFont:public CFont
{..........};
========================
CMFont font;
font.CreateFont(...);
GetDlgItem(IDC_FONTID)->SetFont(&font);
error
error C2664: 'CWnd::SetFont' : cannot convert parameter 1 from 'CMFont **__w64 ' to 'CFont *'
how to CMFont convert CFont
thank
Blog:
http://360.yahoo.com/rxgmoral
|
|
|
|