|
Hmmm.. can't it be a too low value on #define WIN32_VERSION (or whatever that define is called)?
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
Jörgen Sigvardsson wrote:
Hmmm.. can't it be a too low value on #define WIN32_VERSION (or whatever that define is called)?
Having look through the commctrl.h header, it doesn't appear to be a factor. But then Microsoft Headers aren't the best layed out in the world.
I may have a play when I'm on a machine with WTL installed, but I've not had this problem in the past.
Michael
CP Blog [^]
|
|
|
|
|
The problem is (obviously) that ImageList_Read and ImageList_Write are not defined. The reason they're not defined because __IStream_INTERFACE_DEFINED__ is not defined. This is not defined because ObjIdl.h is not included.
ObjIdl.h contains definitions for IStream, which is what the ImageLists are serialised to/from.
There may be some issues with the point at which you include the file, and you may have to a #undef _INC_WINDOWS at some point. There are foggy wisps of memory regarding this, but I'm not sure if it applies to this problem.
Hope this helps,
Phil
--
All things considered, you can't really consider all things ...
|
|
|
|
|
Hi,
1. I have to create a CStatic text and I need it to be without background. How can I do it? Can u write a sample code as simple as you can, please?
2. I have to create a CStatic icon (bitmap) and I need it to be without background. How can I do it? Can u write a sample code as simple as you can, please?
Answer this as fast as you can
Thank you veeeeeeeeeerrrrrrrrrrrryyyyyyyyyyy much
Greatfull,
Ajnstajn
|
|
|
|
|
Bad forum!
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
How can I make my app just multiple dialogs instead of just the one that is defined in enum { IDD = * } ?
I want to make it so that the window (the displayed dialog ) changes when you press a button in the toolbar....
Any help is very welcome
|
|
|
|
|
You'll need to create a seperate CDialogImpl derived class for each dialog and then call them using the DoModal function, or hide the current window and show the new dialog.
Michael
CP Blog [^]
|
|
|
|
|
Please help me.
Let's say we have an COM interface IAppInterface from another application named App.
What I want to do is to create my COM class and implements the IAppInterface.
So I created a new ATL project MyObject, added a simple ATL object, and chose "Implement interface" from the menu.
But after building this project, I cannot see IAppInterface from MyObject. What's wrong?
I know I should do some thing in the .idl file. What should I do?
By the way, I'm using Visual Studio .NET 2003.
Thanks.
|
|
|
|
|
Hi, I would need a small help.
I have developed a static C++ library, in which a class APDU is defined.
Now I am developing an in-process server ATL whose class of implementation will have to
contain as variable member an object APDU.
Accordingly I would like, that the interfaces (what I am creating with the
wizard) they accepted as parameter an object APDU.
EXAMPLE
(We suppose that my server ATL has to print the content of an APDU)
I create my server ATL
(step 1)File--> New--> Project--> ATL COM App Wizard--> project name=server
(step 2) Server Type=DLL
I insert a new object ATL
Insert--> New ATL Object--> Simple Object--> Short Name = example
To this point I want to add a type APDU property to the file idl
Right mouse button-->Add Property
How do I do to make APDU appear the type in the curtain menu that show the
possible types??
Thanks
Anthony
|
|
|
|
|
> How do I do to make APDU appear the type in the curtain menu that show the
possible types??
You don't. Just type your type. All you have to make sure is that the IDL compiler recognizes your type. May or may not be easy.
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
Hi
I have a component implementing a proprietary protocol (say,
Protocol.dll)and does the communciation over serial port. I have defined ATL
objects for each type of packet, and nearly all has a property called
"description" which returns a BSTR.
One ATL object encapsulates the serial communication. So I can set the baud
rate, port number etc.
A connection point event is defined corresponding to each packet that may
arrive to the PC (from the device). Say ProtocolPkt1, ProtocolPkt2,
ProtocolPkt3 etc.
Now we typically use 2 serial ports. One that does proper protocol
communciation and another that dumps trace staements. To take care of the
trace statements I have one event defined (LogData) in the same event
interface described above.
I have an application (say Mainwindow.exe) that uses the above component,
connects to both the ports and has separate event sinks to handle the 2
ports separately. The protocol data and the log data coming from the 2 ports
are to be shown in separate windows. Whenever an event notifies that log
data is received it is simply dumped in a window. Whenever any event
notifying any of the protocol packets is received, the corresponding packet
is created from the bytes received in the event, interpreted and displayed.
Now onto the problem. When some protocol packets are received, the
description property has to be called. When both the ports are connected the
log data comes fine. But when the description property of say ProtocolPkt1
event is called, the BSTR returned is prefixed with some log string that
came in the LogData event. Further the application displays a crash when it
is closed.
Some more observations.
1. This does not happen when the BSTR returned is very short. Typically only
when the string returned is long and computed in some for loop, does this
corruption occur.
2. This does not happen when I use the debug version of Protocol.dll.
I hope I have made myself clear. If any information is required please let
me know. Any pointers that can help me proceed would be greatly appreaciated
Thanks
aby
|
|
|
|
|
>> 2. This does not happen when I use the debug version of Protocol.dll.
Have you tried looking at this article Surviving the Release Version?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Make sure that the code that fires the event manages the life time of the BSTR.
I suspect that the first client is releasing the BSTR and hence ur second client sees garbage.
For events and BSTR the caller allocates and frees the bstr. if u are using _bstr_t always pass a copy to the event( bstrVar.copy())
Hope this helps..
prashu
|
|
|
|
|
Hmm.. never send a copy of a BSTR to a COM method. That means that the method is responsible for cleaning up the string. This however is against COM rules, as [in] parameters MUST be managed by the caller. If the string has to be marshalled through the method call, then the string passed in will be lost (memory leak), and the callee will free a bstr which it does not own (the marshaller owns it).
Thus, if you are using a _bstr_t or a CComBSTR, pass the BSTR pointer (or adress of if passing as an [out] argument) managed by these classes.
[in] parameters are managed by called
[out] parameters are allocated by callee, and passed for ownership to caller
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
Hi!
I recently upgraded from VC 6.0 to VS.net 2002. I am using WTL v7.0. I created a simple modal dialog application and added a web browser control to it. The compilation was successful but the application refuses to create a dialog. Can anyone tell me what I should do to get my app up and running?
After this happened, I created a similar project in VC 6.0 and it seems to work well there.
When I open the same project (that I created in VC 6.0) in vs.net 2002 and convert it to VC 7.0 project and compile it, I get a problem
hRes = _Module.Init(NULL, hInstance);
I replaced this piece of code with
hRes = _Module.Init(NULL, hInstance, &LIBID_ATLLib);
I presume this is because of some ATL incompatibility?!
Can anyone please help me with this?
Thanks!
Ram
|
|
|
|
|
Hi,erveryone, I don't know how to debug my asp component,Can you help me ?Thanks!
|
|
|
|
|
You need to register the DLL in MTS or Component Services first. I will assume you are in Windows 2000/XP so I'll refer to those. Using MTS, the procedure is analogous.
1.- In Component Services, right click on the Application containing your component. Click properties.
2.- Copy the Application ID to clipboard
3.- In Visual C++ with your component project opened. Go to Project Settings.
4.- Be sure it is selected Debug configuration. Go to Debug Tab.
5.- Under "Executable for debug session:" write:
C:\WINNT\system32\DLLHOST.EXE (obviously the path should be the path where DLLHOST.EXE file is in your system)
6.- Under "Program arguments:" write:
/ProcessId:{the application ID you previously copied to clipboard}
7.- Now place a breakpoint where you want to start debugging
8.- Run the component (you will be warned that DLLHOST.EXE doesn't have debug information... just click OK)
9.- Run your ASP Page. When the breakpoint is reached, Visual C++ IDE will be activated for you to continue debugging your component as any Visual C++ program.
10.- If you make changes to your component, you may need to shutdown the component services Application before you can debug it again.
I hope this helps
Jaime
|
|
|
|
|
Hi,
I am developing multithreading COM EXE server. In one of the methods I have called CoCreateInstance, which is made threadsafe by using CSingleLock(&(oneMutext)). After some time of server starts, this CoCreateInstance raises an exception. Also heap get corrupted at this instance.
Can anybody help me in resolving this issue.
Mandar
|
|
|
|
|
Where can I find WTL reference to download it, including explanations of every member functions and variables for every class?
Fore Thanks
Ajnstajn
|
|
|
|
|
Does not exist. CodeProject may have the best collection of WTL stuff available. Search Articles for WTL.
-pete
|
|
|
|
|
|
I think m_spBrowser is in CScanCtl.
|
|
|
|
|
Is there a way in ATL to debug CoTaskMemAlloc/Realloc calls and make sure that CoTaskMemFree was called for every allocation?
thanks
Man Learns from History that he never learns from History
|
|
|
|
|
|
Hi,
I'm having some difficulty implementing a variably multidimensional array.
Each dimension of the array needs to consist of exactly 23 elements, but the number of dimensions is user-specified.
For example the user could request an five dimensional array
int myArray[23][23][23][23][23];
or they could request an array of three dimensions
int myArray[23][23][23];
I know you can use pointers to vary the number elements in each dimension, but is there a way to vary the number of dimensions itself?
Thanks for any help you can give me, this is driving me mad!
Cheers
Mick
|
|
|
|