|
It's likely that you've not initialised a variable - when I've had Release/Debug issues, that's what it's usually been.
I always make sure that I include Debug information in Release builds - that way I can use the debugger with Release builds reasonably meaningfully - as long as you keep optimisations turned on and you use the Release version of the C run-time, you've still got a Release build.
|
|
|
|
|
Thanks, I'll give it a try. I am not sure about having debug info in the release build, but I will use it at least for the sake of finding out what the problem is.
Thank you.
Sarajevo, Bosnia
|
|
|
|
|
Some more info - the debug info will be held separately (in a PDB file), so there is a) no symbol information exposed in the EXE, and b) little change in size in the EXE.
|
|
|
|
|
Hi all!
I'm relatively new to templates and am rapidly learning.. However VC 2005 is giving me fits on type checking STL vs. my old VC 6 compiler.
I have a vector defined: std::vector<char> _iBuff;
With what I want to do, I need access to _iBuff.begin() but if I for example say:
char *b = _iBuff.begin();
I get:
error C2440: 'initializing' : cannot convert from 'std::_Vector_iterator<_Ty,_Alloc>' to 'char'
with
[
_Ty=char,
_Alloc=std::allocator<char>
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
What am I doing wrong? .begin() should return a (char *), or at least I think it should.
Thanks in advance!
|
|
|
|
|
An iterator is not a pointer to an element. VC6 let you do that, but it was always wrong to use iterators that way. Do this:
char* b = &_iBuff.front();
|
|
|
|
|
Mike,
Thanks a million, that did the trick. I should have looked deeper into <vector>, once I looked at the function for .front() it made sense...
Again, my thanks!
|
|
|
|
|
Or do this:
char* b = &(*_iBuff.begin()); as Mike's suggestion to use front() isn't always applicable (such as when you're dealing with an arbitrary iterator).
|
|
|
|
|
Hi everybody. Can somebody please help me with this?
I have a dialog that I use embedded in the tab control, that is on the main dialog. I want to send a user defined message (or is there a better way?) to notify the parent dialog to hide-show itself. How do I go about this?
Thanks.
|
|
|
|
|
You send a user defined message using SendMessage() or PostMessage() . You define a message using #define .
|
|
|
|
|
Thanks, I know that. But the parent dialog does not intercept the message, as I have REFLECT_NOTIFICATIONS defined, so it doesn't work.
|
|
|
|
|
Why don't you get rid of REFLECT_NOTIFICATIONS?
|
|
|
|
|
I can not, because I am using a derived class to embed my dialog class into the tab control, so I need to reflect the messages.
Thanks.
|
|
|
|
|
Define a message ID in the WM_APP range, like this:
#define UWM_SHOW_HIDE_MAIN_WINDOW WM_APP Then in your child dialog:
GetTopLevelParent().SendMessage(WM_APP, show_or_hide_flag); Or you could break it into two messages, one for showing and one for hiding. Handle UWM_SHOW_HIDE_MAIN_WINDOW in your main dialog's message map and show/hide the window accordingly.
|
|
|
|
|
Thanks Mike,
you are as helpful as always. I ran through all of your articles about WTL, but couldn't figure this GetTopLevelParent() out. Thank again.
|
|
|
|
|
I'm using VC 2005, and WTL 7.5. And I cannot for the life of me get intellisense to work with the WTL classes. Has anyone had any luck with this?
Cheers,
- Dan
|
|
|
|
|
It's rather a glib answer - but use Visual Assist[^] - it's a bit pricey, but to be honest, I don't use Visual Studio without it.
|
|
|
|
|
Hi, I'm writing a C++ ATL/COM service on visual studio 20005, my client is written in vb.net also on visual studio 2005.
When I'm trying to call a dcom (on local machine) function the client gets an AccessViolationException.
I have two functions with the same parameters on my interface ,when I call the first function everything is ok and I get the exception only when calling the second function.
I used the attributed flag when I've created the atl class, and I've used custom interface and apartment threading model.
Here are some code lines from my h file:
[helpstring("method Read")] HRESULT Read([in] ULONG address, [in] USHORT dataSize, [in] USHORT stride, [in] USHORT partialDataCount, [in,out, satype("BYTE")] SAFEARRAY **dataBuff, [out,retval] LONG *result);
[helpstring("method Write")] HRESULT Write([in] ULONG address, [in] USHORT dataSize, [in] USHORT stride, [in] USHORT partialDataCount, [in,out, satype("BYTE")] SAFEARRAY **dataBuff, [out,retval] LONG *result);
STDMETHOD(Read)(ULONG address, USHORT dataSize, USHORT stride, USHORT partialDataCount, SAFEARRAY **dataBuff, LONG *result);
STDMETHOD(Write)(ULONG address, USHORT dataSize, USHORT stride, USHORT partialDataCount, SAFEARRAY **dataBuff, LONG *result);
Can any one help me? Please?
Thanks,
Orit
|
|
|
|
|
wrote: Here are some code lines from my h file:
These doesn't help. You need to show, function implemention giving these access violations, and code how you are using it.
|
|
|
|
|
Thanks, I solved the problem by using dual interface instead of custom interface.
My recommendation: use dual interfaces (unless you have a good reason not to), especially if your functions use arrays, I've wasted a lot of time on this.
see:
http://www.codeproject.com/dotnet/opcdotnet.asp?df=100&forumid=2198&exp=0&select=1391649
for more details.
|
|
|
|
|
Good
|
|
|
|
|
hi,
I created two ATL COM projects (Project1 and Project2). If I want to use a enum created in idl file of project1, in the idl file of project2, what are the steps that have to be followed. Please enlighten me.
Thanks in advance.
|
|
|
|
|
First off, I'm running Visual C++ 6.0. With the MFC CDialog class, if you want to provide context-sensitive help for your app, you just define a COMMAND_ID handler in the message map for the ID_HELP message ID. That way, when the user presses F1, the method pointed to in the COMMAND_ID entry in the message map is called and you can display your help app. Is there something similar in an CAxDialogImpl derived class?
|
|
|
|
|
The dialog gets a WM_HELP message when you hit F1.
|
|
|
|
|
Thanks, I'll check this out tomorrow.
|
|
|
|
|
This worked. Thanks again.
|
|
|
|