|
vcforums wrote: if you suggest good topic for networking project kindly give me a reply.
What about making NETWORK ShutDowner
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi All,
I have been using CString for years and was very much comfortable with it.
Now i am using STL's string.
while debugging i am not able to get the value of a string variable.it shows the address and not the value(string::c_str).
if it was a CString variable, just by putting the variable in the Quick Watch i was able to see its contents.
How do i get the value of a string variable during debugging ?
Thanks in advance
|
|
|
|
|
It almost sounds like you need to add an entry to your autoexp.dat file. You'd see the same thing with CString if it weren't for that file.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi David,,
I'd be very interested to know what you exactely mean with your answer. I thought there was no (easy) way to see the content of stl strings while debugging... What is autoexp.dat ?
~RaGE();
|
|
|
|
|
Rage wrote: I thought there was no (easy) way to see the content of stl strings while debugging
I don't use STL, so that may very well be the case.
Rage wrote: What is autoexp.dat ?
It's a file located in the C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin folder. There is a good description at the top of it.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
DavidCrow wrote:
It's a file located in the C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin folder. There is a good description at the top of it.
This is very interesting, thank you David, for the explanation.
~RaGE();
|
|
|
|
|
Could this be of any help :
Article[^]
~RaGE();
|
|
|
|
|
How to open a default fil by using the CFileDialog class
I open the dialog box like this .
I want to keep one file as default selection
CFileDialog dlg(TRUE,"bmp",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,"Only BMP (*.bmp)|*.bmp|");
dlg.DoModal ();
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Use
<br />
dlg.m_ofn.lpstrFile=TEXT("DefaultFile.xxx");<br />
before DoModal()
Have a nice code day
|
|
|
|
|
I need to open a file named "1.bmp" located as "c:\1.bmp"
but i get assertion for invalid address
ASSERT(AfxIsValidAddress(m_ofn.lpstrFile, m_ofn.nMaxFile));
My code is somthing like this :--------
CFileDialog dlg(TRUE,"bmp",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,"Only BMP (*.bmp)|*.bmp|");<br />
<br />
dlg.m_ofn.lpstrFile=TEXT("c:\\1.bmp");<br />
<br />
dlg.DoModal ();
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
sorry (error),
now try with this:
<br />
TCHAR str[100]=TEXT("c:\\1.bmp");<br />
dlg.m_ofn.lpstrFile=str;<br />
Have a nice code day
|
|
|
|
|
sorry there is some problem in the given code also
some assertion at
ASSERT(m_hFile != (UINT)hFileNull);
I thing will have to go through the sturctre method
i found some links will try from it
http://eatworms.swmed.edu/~boris/B_Player/VideoWnd.cpp
http://www.codeproject.com/dialog/remove_filters.asp
Why simpe things are done so complicated in VC++
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I don't know, it is strange!
A good thing could be add the flag OFN_FILEMUSTEXIST here:
CFileDialog dlg(TRUE,"bmp",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,"Only BMP (*.bmp)|*.bmp|");
So you are sure that the file exist.
And I don't like very much
...,"Only BMP (*.bmp)|*.bmp|"
I prefere
...,"Only BMP (*.bmp)|*.bmp||"
Let me know
Have a nice code day
|
|
|
|
|
I will have to get the exact error if u have tested the code
so u might be right ,
can be some error in my code .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
_Russell_ wrote: dlg.m_ofn.lpstrFile=str;
If lpstrFile is assigned a non-NULL value, so must nMaxFile also be used to indicate the size of the buffer pointed to by lpstrFile .
Why do it this way, however, when the constructor already has provisions for such?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
vikas amin wrote: How to open a default fil by using the CFileDialog class
That is what the third parameter of CFileDialog 's constructor is for.
vikas amin wrote: I need to open a file named "1.bmp" located as "c:\1.bmp"
Then why bother with CFileDialog if you already know the name of the file?
Also, the filter should end with two ‘|’ characters.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
yep if he knows filename & location then why he is using CFileDialog .
well i guess he wants to show his skills here.;)
|
|
|
|
|
vikas amin wrote:
I need to open a file named "1.bmp" located as "c:\1.bmp"
Then why bother with CFileDialog if you already know the name of the file?
Yeh good qestion , i need this only for Testing purpose &
when i cannot reach some thing in coding
it makes me crazy to get it done .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
please tell me what's a callback function?
i've read it many times but i'm understanding it. whats the differnce between CallBack function and a normal function. please dont give a link. which i'm not going to understand. instead explain me.. with a little example. pleeeeeez
regards,
Rookie
Installing MFC...2% complete
|
|
|
|
|
A callback function is a normal function that the system calls when comes specified events.
An event could be a mouse click, or a tollbar botton click, ....
To link the event to the function it is used the MESSAGE_MAP
(usually in this macros are used the IDs of the objects that the user is using)
is it OK?
Have a nice code day
|
|
|
|
|
fisrt of all thanks for your patience,
for the first time i think i've understood whats a callback.
See here
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg,WPARAM wParam, LPARAM lParam)
as i've read,WndProc processes all the messages send by the applications. right? so a message "coming" makes an event which inturn calls this CALLBACK wndProc right? am i right?
regards,
Rookie
Installing MFC...2% complete
|
|
|
|
|
Rokiee wrote: am i right?
Yes.
Have a nice code day
|
|
|
|
|
can i come with another dumb question?? later?
regards,
Rookie
Installing MFC...2% complete
|
|
|
|
|
Rokiee wrote: can i come with another dumb question??
Of course you can. This is the purpose of this message board
|
|
|
|
|
so nice of you
regards,
Rookie
Installing MFC...2% complete
|
|
|
|