ok, I'll try that. In fact the idea is not to include the parameters in the define... What I don't understand is what it will do in release mode : 0(myparameters). This should crash, shouldn't it ? Or maybe there's something I missed in #define principle ;) thanks Ed
Ed01
Posts
-
log file -
log fileHi, I wrote a function with variable parameters to do some log stuff in my project. The function prototype looks like this :
static void write(char* str,...);
What I wish to do is to link this function to a #define so that I can easily get rid of all my logs. The code should look like this :#ifdef _DEBUG #define VCNLOG(x) write(x) #else #define VCNLOG(x) #endif // somewhere else... VCNLOG("my value is %i",var);
But this doesn't work due to the variable parameters (Visual complains about too much parameters in macro VCNLOG) Any idea of how to get this work ? thanks, Ed -
Control of ActiveX objects opened in IEHi, I'm building a secure web browser in MFC. My project is based on the CHTMLView wrapper. Currently, my problem is that for exemple when you open a pdf file on the internet, you can directly open it in ie. I mean, ie will launch a pdf viewer component. And in this pdf viewer, you'll be able to do everything you want, for exemple saving the pdf file. So, I'd like to find a way to get control over this component in order, for exemple, to unable the user to save the pdf doc. The problem is that as soon as the component is launched, all windows messages are mapped to this component and not to the CHTMLView object anymore. Furthermore, I didn't find any messages (if only there is one) that is send to CHTMLView to "tell" it that a component such as a pdf viewer will now be opened inside it. Is anyone knowing how to do such a thing ? thanks Ed
-
one or many queue timers ?Hi, I have to use a timer to perform some tasks at specific intervals. The timer needs to be very accurate (+- 10 ms) and use as less CPU as possible. So I decided to use a queue timer, which seems to be the better choice. In fact, I have to trigger many events at different intervals. For exemple, I have to do something each 30 ms, another task each 120 ms and another one each 350 ms (between 1 to 25 events to trigger). What I'd like to know is which is the best solution : - using only one timer that calls only one callback procedure each 10 ms for exemple and in this procedure increments variables to know which task to process - or set up one timer with one callback procedure for each task I'd like to perform. (so it's as if I defined 25 timers but with intervalls of 30 ms, 120 ms, 350 ms ...) Thanks... Edouard
-
Support for ActiveX in MFC projectsthanks, I won a lot of time... For anyone who has the same problem, you just have to add AfxEnableControlContainer(); at the beginning of the InitInstance() function in your App class ! :-D
-
Support for ActiveX in MFC projectsHi, I've created an MFC project (a Single document application) in Visual C++ 6.0 and I didn't check the "ActiveX support" box. And by now, I have to insert an ActiveX control in my project ! Of Course, It doesn't work... :(( So, is there a way to add Active X support without restarting my project from scratch ? Thanks...