|
If you mean an ActiveX DLL, then this is a COM dll. So you can use whatever your favoured C++ method for accessing COM objects.
I prefer #import as that generates a nice C++ wrapper, but you can use the old fashioned CoCreateInstance as well. Have a read on MSDN for more details.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
I am facing a problem with a small application that I have recently developed. The application runs well for a few days and at a moment there is an error message like “User Breakpoint called from code” … when I debug the application it stops at a line where in assembly the code looks like “int 3” . Anyone has any suggestion about how to track this in my code.
Thank you.
|
|
|
|
|
Try looking at the Call Stack (one of the tabs at the bottom in Visual Studio) to see where the current method/function is being called. You'll get a hint at which call went wrong.
|
|
|
|
|
There are many reasons behind this, I think this is due to the memory over usage. If you allocate N Bytes of memory but >N Bytes of memory is used and then you try to delete the memory it gives the same problem. Check in the code the memory should not be over used.
Regards
Atul
|
|
|
|
|
micutzu wrote:
when I debug the application it stops at a line where in assembly the code looks like “int 3”
Are you debugging the DEBUG mode application or RELEASE mode Application.If you try to DEBUG MODE application, the debugger will point you actual line of fault.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Thank you for your reply.
I do debug the release version - where I can see only the assembly code. The debug version never crushes - since as far as I know the debug version does handle a little bit diffrent the events.
|
|
|
|
|
micutzu wrote:
debug the release version - where I can see only the assembly code
I Believe, Only this article can help you :-
http://www.codeproject.com/debug/survivereleasever.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Thank you. I will read the article and maybe find the cause of the problem.
|
|
|
|
|
You may want to use PJN's excellent CExceptionLogger[^] to identify problems in release builds. I've used it with great success in the past - it's a real lifesaver!
Caveat: for accurate identification of problematic code, you'll need to disable optimization.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I do debug the release version - where I can see only the assembly code. The debug version never crushes - since as far as I know the debug version does handle a little bit diffrent the events.
You have probably heard this a million times, but one of the first things to check when your releasse crashes and debug does NOT is to search for the use of uninitialized variables - especially ANYTHING that is a pointer. Maybe you can set your compiler to warning level 4 (if you have not done so already), and if you thought the 'use of X before it has been initialized' was just warning, then you should treat all of those as errors.
|
|
|
|
|
Hello,
dou you resolve your problem? i have the same! every times when the destructor from CString is called or = operator i recive the same error!!
Example:
CString csString;
csString = "www.codeproject.com"; // ok, no problem
next iterator,
now ist in csString something like this:"îþîþîþîþîþîþîþîîþîþîþîþîþîþîþîîþîþîþîþîþîþîþîîþîþî" ???
whats this???
when i try to add a new value to csString to overwrite him com's a problem:
csString = "myString"; // problem here
or
csString = ""; // problem to!
in dissasembly is:
004030A5 call CString::operator= (0040956e) // in this line brak the programm??
any idea how to use this CString?
regards
mirso
|
|
|
|
|
Hello,
Well - I was not able to solve the problem ... but I had developed a work around which I think is the solution is your case as well.
You are using CString - which is very easy to use. Try LPSTR.
Regards,
Dan.
|
|
|
|
|
Hey all,
I've got an application running the XP Style interface where the scroll bars are nicely shaded, buttons are highlighted, etc. However, in any CWnd derived class, if I call ShowScrollBar(), the scroll bar will still look like the old pre-XP style scroll bar. However, this problem does not happen in common MFC classes like CScrollView or CListCtrl - only my own CWnd classes. It looks horrible when the rest of my app is in the XP style look. Any suggestions?
To reproduce the problem, I think all one needs to do is create a new CWnd somewhere and call ShowScrollBar(). It will sport the old look, rather than the new XP look.
EDIT: I solved this problem. If anyone is interested, such behavior occurs when ShowScrollBar() is called before SetScrollRange() or SetScrollInfo() is called to set up the non-client scrollers.
|
|
|
|
|
Do you find that if you call SetScrollInfo and specify the nPage size in the structure to resize the thum, the scroll bar doesn't scroll all the way to the max value?
I can't find the correct way to fix this other than changing the max value.
|
|
|
|
|
Hello there,
I have a problem with the order of how folders and files are listed when I use CFileDialog-class.
Normally when calling the box, it first lists all folders then all files (in alphabetic order).
For some days now the order is reversed. So first all the files THEN all the folders. I can change the order each time with help of the "options" button (==> Show Details ==> then click on "Name") but I have to do that each time I use the CFileDialog in my program.
Actually the same thing already happens in only AOME of my windows programs (e.g. in Netscape yes but in Word not...)
Anybody any idea?? Any help or hint is appreciated!
Kai
Kai
|
|
|
|
|
I have some utility functions that I would like to put into a library. I want the library to be used like you would for example the cos(x) function from the math library.
All you have to do is include the header
#include <math.h>
Then you can use the function
float result = cos(somenum);
How do you accomplish this?
|
|
|
|
|
Create a static library project containing your utility functions (menu File->New->Project, choose Visual C++ Projects, then select the template Win32 Project. Finally in the wizard, select the Static Library option). Once compiled your will get one .h and one .lib file, which you can include within your other projects.
|
|
|
|
|
Thanks for the response. I will try that once I get a moment.
Will I need to extern "C" the functions or anything else special?
|
|
|
|
|
To make a utility function in a library available for use, you need something like the following in your .h file:
extern "C"
{
declspec(dllexport) void MyFunc(int i);
}
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
|
Hi,
I want to know how can I power on a computer in a network?
Cheers,
Thanks.
|
|
|
|
|
search WAKE ON LAN on google
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Imagine a situation in which Dialog Box added to TabCtrl is bigger. Than I think TabCtrl should provide a scrollbar. But I am not getting any ScrollBar. So what might be the problem. Is it by default or I have to set some properties.
Thanks
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
Bahadur - yar - Jung wrote:
hich Dialog Box added to TabCtrl is bigger. Than I think TabCtrl should provide a scrollbar.
Yeap It is Default, TabCtrl resize dialog box according to it size .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Thanks for replyieng.
I tried a simple sample program and I am not able to see both horizontle and verticle scrollbars. I mean they are not visible by default. Do I need to enable certain properties ?
Thanks again.
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|