|
Hi,
I am looking for the simpliest way to make the status bar show help messages for toolbar buttons (just like in MFC apps). Is there (in WTL) some hidden feature that can be just enabled, or do I have to make it all myself?
Thanks for any suggestions,
Vlasta
|
|
|
|
|
Hello,
I am trying to create a "Windowed Only" ActiveX control in .Net Studio using ATL. I set the appropriate flag in ATL control wizard when adding a new class to my project. But it looks like it does not have any affect. My control still does not get any window messages and Spy++ indicates it has no window.
I tried to create two similar classes using wizard -- in one case I set "Windowed Only" flag, in another case I don't. Then I compared the generated code -- no difference.
What am I doing wrong? Please, help!
--Daniel
|
|
|
|
|
I have encountered this problem too.
Add this to your constructor:
m_bWindowOnly = TRUE;
It is a public member of one of the inherited classes which seems to do the trick. I do not know if this is how MS meant it to be, but it worked for me.
Vlasta
|
|
|
|
|
Where can I find a good tutorial to learn how to program Windows apps with ATL (WTL) and some basics about this 2 libs? I want use it to make apps for a pocket pc.
--
Nice greets, Daniel.
|
|
|
|
|
AFAIK there is no easy way to write WTL-apps for the pocket PC. I read 6 months ago or so about someone having ported WTL for Windows CE. Check out groups.yahoo.com/wtl[^]
--
Please state the nature of your medical emergency.
|
|
|
|
|
I've created an activex control using ATL, were my method calls the findwindow api. The container is passing the title of the window and I want to pass back the handle of the window to the container.
my idl contruct is setup like this
[id(1), helpstring("method FindWin")] HRESULT FindWin([in]BSTR lpWinName, [out, retval]long* retval);
Originally the return value was [out, retval]HWND* hWnd); but I had problems.
Can someone tell me if I'm in the right neighborhood on this?
That to return this value I do:
USES_CONVERSION;
LPSTR WinName = W2A(lpWinName);
HWND pHandle;
pHandle = FindWindow(NULL, WinName);
retval = (long)pHandle;
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
|
I just made a fresh install of Visual Studio 6 and I installed service pack 5. Then I added the WTL70 include files to the include directory of visual c and I tried to compile an example program.
I had exactly the same problem with windows 98, now I run Win2000 professional and I get the same problem again.
What more do I need to compile WTL with
#define _WIN32_IE 0x0500 ?
I did a MSDN search on 'LPNMREBARCHEVRON' but that didn't bring a solution...
--------Configuration: WTLExplorer - Win32 Debug---
Compiling...
stdafx.cpp
..\include\atlframe.h(273) : error C2146: syntax error : missing ';' before identifier 'lpnm'
..\include\atlframe.h(904) : see reference to class template instantiation 'WTL::CFrameWindowImplBase<TBase,TWinTraits>' being compiled
..\include\atlframe.h(273) : error C2501: 'LPNMREBARCHEVRON' : missing storage-class or type specifiers
..\include\atlframe.h(904) : see reference to class template instantiation 'WTL::CFrameWindowImplBase<TBase,TWinTraits>' being compiled
..\include\atlframe.h(273) : error C2501: 'lpnm' : missing storage-class or type specifiers
..\include\atlframe.h(904) : see reference to class template instantiation 'WTL::CFrameWindowImplBase<TBase,TWinTraits>' being compiled
Error executing cl.exe.
WTLExplorer.exe - 3 error(s), 0 warning(s)
Thanks a lot in advance, this problem has been bugging me for ages now.
Kind regards, Griffith Sutherns
Everything you say will be misquoted, ripped out of context and used against you.
|
|
|
|
|
You need the Platform SDK installed. If you have it, check your VC Directories settings and make the PSDK install dir higher in the list than the vc98\include dir.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Ahh thanks, that must've been the problem.
It's strange I never read the platform SDK was required. (Most things compiled fine without it). And I still have the impression it wasn't worth the 200mb download...
Thanks a lot for helping me out,
Kind regards,
Griffith
Everything you say will be misquoted, ripped out of context and used against you.
|
|
|
|
|
As a beginer of ATL Based Web Service programmer, I have some some questions about it:
1)Whether a Web Sevice can hold its state during its serving many clients, for I want keep some data structs among clients because these clients are collorating doing a certain work. If Web Service can has this virtue, how can I do, are there some documents about it?
2) can a web service client dynamicly locate the server without recompiling its source files When a Web Service provider changes its location on the internet? If it can, how can I do and are there some documents about it?
Please help me, thank you!
oyyx@sina.com
|
|
|
|
|
Hi,
I have a COM server without idl/tlb files.
Can anybody tell how to get/generate a tlb from an exe which doesn't have an idl? I understand without idl , it is not possible to generate tlb. This server supports ATL but doesnot have its own idl file.
|
|
|
|
|
- if you are using VC++7 and especially the latest ATL class wizards, you actually end up with interface declaration, class inheritance, and class implementation in the same non-idl file. That's what MS sees good as the new "Attribute-programming" style.
So you don't have a dedicated idl file, but it produces a standard tlb. No need to say I don't recommend this programming style sort of i-put-together-in-the-same-file, as it is a couple miles away from standard object modelling.
- by the way, if you need some idl format, you may just view and extract the content of the .tlb file using OleView (one of the tools with VC++).
And I swallow a small raisin.
|
|
|
|
|
Actually, I have a COM Server ( an .Exe) with no tlb. I have to create its assembly for which it needs a tlb file. If I try to add a reference directly in .Net environment, it reports an error that it is not a valid COM Component.
But In VC++6.0, I can do the createinstance of this server. So that means it is a com component. and also in the registry the information available indicate that it is an OUTPROC Server.
In VC++ 6.0, I can directly use the CLSID of this COMServer and communicate with the interfaces that it wraps.
Do u know if we have any means in C# using which we can invoke this server?
Confused
Rais
|
|
|
|
|
Get it clear : a COM server (.dll or .exe) comes with a .tlb, by definition. If not, no client application would be able to do successfully CoCreateInstance() on it.
What I guess is that in your case the .tlb file is embedded in the .exe file rather than separate, which is common (usually developers add a reference to the .tlb file generated at compile-time in the .rc resource file).
Have you tried to do "tlbimp <comservername.exe>" ? (from the MSDN doc, tlbimp does apply to any file with a tlb content inside).
MSDN doc.
There is no reason it doesn't work, and if you really need the .tlb file itself you may just as well use a resource file editor, and extract the type-library from it like you would with a picture.
Good luck!
And I swallow a small raisin.
|
|
|
|
|
Hi,
I have tried this too. but tlbIml gives an error that it is not a valid com server, though in the registry it maintains all the information like its ProgId, CLSID, server version, etc....
This server has been created using Custom interfaces.
In VC++ , I can develop a client that launches this server on doing CoCreateInstance(...).
Confused!!!
|
|
|
|
|
"Custom interfaces" is something you have invented.
You have COM interfaces, and that's all.
Post code snippets, at least SOME people MAY see and tell you;
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site. Support for development will ship at the same time as the Windows XP Service Pack 1 (SP1) release.
|
|
|
|
|
Utilize the OLEVIEW tool. OLEVIEW has an Explorer-like browser.
1. Open Object Classes - All Objects and attempt to find your COM server which probably will be listed by Prog ID. This assumes that your COM server is registered of course.
2. Open Type Libraries - To attempt to view the type library. This assumes that there is a type library and the type lib is registered.
Note that both attempts may require some insightfull searching but visits to OLEVIEW typically prove to be fruitful.
Typically (but not always) type libraries are embedded in com server modules. VBers only need to add a reference to the typelibrary via a browser in there IDE. The would need to know the library name or the location of the exe,dll,exe,tlb file. C++ people may obtain type-lib info, including headers for compilation, by using the #import directive. See your local MSDN for more information.
Example
#import "C:\Program Files\JMPS\bin\JmpsFramework.tlb" raw_interfaces_only, raw_native_types, no_namespace, named_guids
Note that this will generate JmpsFramework.tlh in my build directory.
Note that some COM servers do not has tlbs - they use standard marshalling or may be a simple com server that does not intend to marshall such as a simple learning exercise.
beamsack
|
|
|
|
|
The last line in your mail is of importance to me. I am using a COM server which does not have a tlb. Its using custom interfaces.
Can I use such a server using Automation clients like VB? If so, how?
In C#, in order to use a COM Component, the precondition is that it should have either a tlb or the server should carry this information within itself.
Only then, C# can create an assembly for this.
But since in my case I neither have a tlb, nor does the com server carries such information, I am unable to use it directly in C#.
Can you please look into it.
Thanks in advance
Rais
|
|
|
|
|
Rais,
I would say that you must have a type library in order to use the COM server. I believe standard marshalling is limited to C++. Header inforation is generated with the proxy/stub code. VB would have no idea of the types you would wish to use. I don't think automation will work without a tlb - you can test the possibility by creating a windows scripting host file and
Object myServer = _ <br />
CreateObject("MyProg.Identifier")<br />
myServer.MyMethodIHopeToCall You must have a proxy/stub dll if you don't have a type library. It may even work because typically marshalling is not required for inproc COM servers, but the OS may place your server in a "delegate process". Therefore it is highly recommended that some type of type library or proxy stub dll exist.
|
|
|
|
|
Hi,
I have an STL string pair (using a map) and every value is unique (just like the keys are unique). Sometimes, I need to "flip" the keys and the values, so the keys would become the values and the values become the keys.
Is there a built-in function that would allow me to do this without having to create a new map and do this through a loop?
Thanks!
|
|
|
|
|
Hi Chris,
I happen to be in the process of writing an STL-like bidirectional map, i.e. one for which you can lookup by key and by value. As my workload does not allow me to finish the thing, it'll be quite a while till I finally get to post it to CP. Nevertheless, if you're curious I can send to you what I have right now (it's already pretty functional, and beta testers are always great ).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I've been looking for this for several years now. At one point I was going to write one myself, but I'm not a stl guru. Please email me this if you can at drescherjm@hotmail.com
Thanks,
John M. Drescher
|
|
|
|
|
I am looking forward to such an article. In my applications I have been using two maps depending on what keys I needed. I am also intereseted in becoming your beta tester of course .
Best regards,
Alexandru Savescu
|
|
|
|
|
Chris Hambleton wrote:
Is there a built-in function that would allow me to do this without having to create a new map and do this through a loop?
Nope. A map is normally a red-black tree implementation, so by swapping a key-value pair, you've essentially invalidated the location of that node in the tree.
You can always remove the key-value pair first and then add the swapped values back in the tree. (More overhead, less memory usage of course.)
Brandon
|
|
|
|