|
i dont say that problem is file i say maybe.
if you want to add items to listbox do you get error
if he use listbox
-- modified at 7:28 Friday 12th May, 2006
it worked
m_List.Create(WS_VSCROLL|WS_BORDER|WS_HSCROLL|WS_CHILD|WS_VISIBLE,CRect(0,0,100,100),this,1);
WIN32_FIND_DATA find;
HANDLE handle;
handle=FindFirstFile("*.*",&find);
for(int i=0;i<10;i++)
{
m_List.AddString(find.cFileName);
if(!FindNextFile(handle,&find))
break;
}
FindClose(handle);
|
|
|
|
|
Correct me if I'm wrong, but you can't initialize a listbox in InitInstance.
Try doing it in OnInitDialog instead.
|
|
|
|
|
vinaycool wrote: while posting try to give more details abt the req so u get good solutions.
please try not use SMS language here, hope i am not sounding like any bore lecturer
"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
|
|
|
|
|
i second you Alok, i DO am bored about that too, because i make efforts to speak an english that everyone can understand (while english is not my mother tongue), and these guys come with the sms-ed language and want, want, want the worst thing is that i'm sure they don't behave like that in real life
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Start your debugger (press F5) and set breakpoints in your prog to see where it crashes. You can also use the Callstack window to see which was the last of your functions called (and probably giving you the error).
Cédric Moonen
Software developper
Charting control
|
|
|
|
|
Cedric Moonen wrote: Software developper
NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!
"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
|
|
|
|
|
ThatsAlok wrote: NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!
Yes
Cédric Moonen
Software developper
Charting control
|
|
|
|
|
|
Cedric Moonen wrote: Yes
Me Too...
"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
|
|
|
|
|
Anu_Bala wrote: Hi, I got Unhandled Exception in my coding,and i debugged through my coding,the unhandled exception came in disassembly section.Why its come in disassembly ?Wats the reason?
Could you show me your Code of that Function, Plus in Continuation With Cedric! provide error handlling to your sourcecode using try and catch block, which might return qith cause of error.
e.g.
try
{
}
catch(CException &e)
{
}
"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
|
|
|
|
|
this will work only if the exception thrown is a CException (or inherits from CException), so there are many chances that it doesn't catch the exception like that.
he'd better catch(...) and debug...
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
toxcct wrote: is will work only if the exception thrown is a CException (or inherits from CException), so there are many chances that it doesn't catch the exception like that.he'd better catch(...) and debug...
Since the Gal is using MFC application!, and she is getting Unhandlled Exception in InitInstance!, so chance of catching the Exception by CException Class is very bright, since CException is the base class for all exceptions in the Microsoft Foundation Class Library (According to MSDN)
"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
|
|
|
|
|
Anu_Bala wrote: Hi, I got Unhandled Exception in my coding,and i debugged through my coding,the unhandled exception came in disassembly section.
Any time you throw an exception if you look in the debugger the exception will originate from code in (or called from) the Win32 RaiseException API exported from kernel32.dll. Nothing unusual about this. Get a call stack and look for the closest calling client code.
Steve
|
|
|
|
|
Hi,
Can any one tell how to start & stop the progress bar ..??
Thanks in advance,
Vinay Charan
|
|
|
|
|
like this
<br />
CProgressCtrl m_Progress;<br />
m_Progress.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,100,20),this,1);<br />
m_Progress.SetPos(0);<br />
m_Progress.SetRange(0,100);<br />
m_Progress.StepIt();
|
|
|
|
|
Hi,
I added the code to InitDialog but the progress bar did nt start,whats the reason ??
|
|
|
|
|
you need to use StepIt in one loop or wm_time or thread or anything that need to progress ,you can use Progress from Toolbax or if you want to create CProgress you want declare CProgressCtrl m_Progress; in header file not one function
|
|
|
|
|
vinaycool wrote: I added the code to InitDialog but the progress bar did nt start,whats the reason ?
Add a button on the Dialog Box window! and on Message Handller of the Button Call the CProgressBar::StepIt function!
"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
|
|
|
|
|
vinaycool wrote: the progress bar ..??
which ?
vinaycool wrote: Can any one tell how to start & stop
a progress bar doesn't increment itself. YOU do it. stop calling StepIt()[^] and it won't progress anymore.
one question though : don't you have any need to take a good book about MFC, sit and learn ?
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Yes I have to bcoz i have just started with VC++
Thanks for the advice...
|
|
|
|
|
vinaycool wrote: Yes I have to bcoz i have just started with VC++
Good, Then you are in Right Place !
"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, I know that might sound like a dumb question to you but I really don't know the answer, I have some classes that I use frequently in my projects, I have those classes in header files only, ie. all the code is in the header file, I have the path to those header files set in visual studio and I include them in my projects as normal using #include <myclasses.h>, this works perfectly, but now I'm having troubles adding a static member variable, it only works when I declare the static member variable in a .cpp file, so, I'm now trying to have the class definition in a header file and the implementation in a .cpp file, my question is how can I still include the header file and use the classes in my projects? is using a library the only option? I prefer not to use a library so that I can modify the code of the classes without having to recomplile the library, but is there a way to do that? I tried adding the path to the .cpp implmentation file under source files in visual studio options but no use it still gives me an unresolved external symbol error, it's mentioned in the documentation of visual studio that the source files are used for intellisense ... any ideas are appreciated
(a.k.a. Wal2k) www.wal2k.com
|
|
|
|
|
Declare the static member in the .h file and use __declspec(selectany). This tells the linker to just pick one symbol if it's multiply defined and discard the rest.
Edit: Above is if you want to still keep everything in your header file. This results in longer compilation times but is useful if your classes are basically template classes. If you want to go with the .cpp and .h route, you will either have to include the .cpp file in your project, or link to a library with the symbol defined.
-- modified at 6:46 Friday 12th May, 2006
|
|
|
|
|
|
oh, and something else, I want to separate the class definition in a header file and the class implementation in a .cpp file in order not to have all the methods as inline methods, it's good for small methods but for large methods it really increases the size of your executables considerably
(a.k.a. Wal2k) www.wal2k.com
|
|
|
|