|
Hi
Is anyone here using VS2005 Beta 1. Im trying to add a property to an interface on a small COM dll and the wizard gives tells me that there is a syntax error. Obviosly it does not create the code after that. Am I alone in experiancing this, does some wise soul out there have an answer?
|
|
|
|
|
Hi there,
Can anyone tell me how to set the initial postion of a deskband.
I have succesfull executed the Band Object Implementation Sample from MSDN
But the desk band Initially is always, docked on the taskbar.
What I want is, initially, the deskband to be docked on the right side of the screen.
Thanks in advance,
Kumar.
|
|
|
|
|
I have a tree structure that I need to display in various places in my application. I was wondering if it's possible to re-use the same CTreeViewCtrl/HTREEITEM in my different dialogs or do I have to re-initialise the tree structures each time?
Thanks in advance.
|
|
|
|
|
Hello ecerybody.
I have a DLL created with ATL.
In this dll there is a Function by name:
MyFunc();
In my mfc app I use this line:
#import "MyDll.dll"
MyFunc.
But my app can't know what I want.
Please tell me how I can Create A DLL I CAN
EXPORT CLASSES AND THEN HOW CAN I IMPORT AND USE
THAT CLASSES IN MFC APP.
Best Wishes.
Thanks.
|
|
|
|
|
Check out __declspec(dllexport) and __declspec(dllimport).
If you use the Application Wizard to generate a DLL, it produces an example you can then extend.
The "#import" is for COM objects, and for individual functions, won't work, although you could use __declspec(dllexport) in the definition of MyFunc(), and then use either an import library or LoadLibrary/GetProcAddress to call the function.
Steve S
Developer for hire
|
|
|
|
|
|
Hi,
I have a CListViewCtrl with images and am trying to add two buttons: "Move Up" and "Move Down" that move a selected row in the CLIstViewCtrl. I am currently "swapping" rows in the ctrl by deleting and adding rows at each position with the other's contents. The problem with this method is that in my case I need to know what the contents in the row are to display the proper image.
Maybe I am totally missing something but is there a more general way to do this, e.g. a simple swap function or some methods to get at the underlying row data.
Thanks in advance.
|
|
|
|
|
If anyone can point me to where i can learn about using DirectX with WTL it would be greatly appreciated. There doesn't seem to be much info on this in the WTL section (except for the CGameLoop article).
Thanks.
|
|
|
|
|
Although not WTL, there are some good articles available for setting up DirectX with MFC. This article was invaluable setting up a frameworks for use with MFC and Win32.
You'll need to handle at least:
Getting the window handle for the target window
Doing the DirectX initialisation (DX samples)
Handle an idle or timer message to trigger a render / physics update
Handle the window creation message
Handle a window resize message
Handle the on erase background message
[edit: corrected link]
|
|
|
|
|
Hello all!!!
I need to choose MFC class CList or STL list.
When do I choose MFC and when do I choose STL?.
Please, if someone can help me what are the benefits and what are the lacks.
Regards,
Shlomi
|
|
|
|
|
If at all possible use STL. I shied away from STL for quite some time while learning MFC, which looking back was a mistake. STL takes a bit of hit learning but is great once you do, and of course it is portable, unlike MFC.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Unless there are convenient reasons not to, e.g., interacting with MFC serialization, I would go for STL. STL is generally much more powerful. As Neville says below there is a learning curve but it's worth it. Plus I found that STL was easier to use than it was to understand!
I often use CString in preference to string in an MFC app. because it makes for easier interaction with MFC controls, etc., and it has better functionality. For everything else I go for STL these days.
Kevin
|
|
|
|
|
Hi fellows,
Thank you for your lovely help.
Regards,
Shlomi
|
|
|
|
|
Hi,
I have created an ATL dll which has a modeless dialog box containing a WebBrowser control. My problem is that whenever I'm pressing TAB key over the WebBrowser control, the focus is not shifting to other controls or links within the web page which is getting displayed within the control.
I have implemented a hook to trap WH_GETMESSAGE message, after that I'm able to get response from the 4 arrow keys and TAB key, but that too within the dialog box.
I have to make the TAB key acting normal within the WebBrowser control that is within that dialog box.
Can anyone of you help me out? Thanks in advance.
Regards,
Ashish
|
|
|
|
|
The short answer is that the dialog owner needs to forward keystrokes to the CAxWindow that ATL uses to host the WB control. If you get the WTL AppWizard and use it to make a modeless dialog-based app, you'll see the necessary code in the generated PreTranslateMessage() .
--Mike--
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb
|
|
|
|
|
Hi all,
I have really big problem w/ my web servervice.
I implemented the web server w/ ATL, so now I have a Cws ATL class that implements the web service and a CwsIsapi that implements the ISAPI extension. Then I am consuming this web service in C#.
/////////////////////// ATL WEB SERVER /////////////////////////
<br />
class Cws<br />
{<br />
[soap_method]<br />
HRESULT init ( int num) {<br />
m_mem = num;<br />
return S_OK;<br />
};<br />
[soap_method]<br />
HRESULT get_number ( int *val)<br />
{<br />
*val = num;<br />
return S_OK;<br />
}<br />
protected:<br />
int m_mem;<br />
};<br />
/////////////////////////////// C# CONSUMER ///////////////////////////////////////////
<br />
...<br />
mymachine.Cws service = new mymachine.Cws ();<br />
service.init (3);<br />
int val;<br />
service.get_number (out val);<br />
if (val != 3)<br />
{<br />
}<br />
...<br />
This code DOES NOT WORK !!!
In fact when
"service.get_number (out val)"
is invoked, an instance of Cws is created then destroyed, so when
"service.get_number (out val)"
is invoked, the instance is different and m_mem is not initialized to 3 any more !!!
Is there any way in order to change this behaviour?
Any help will be appreciated.
Thanx very much.
Regards,
Andrea
|
|
|
|
|
Web services are a stateless RPC protocol. After the call is finished the instance is destroyed. There is a way to enable session state in web services but I don't know how to do it in ATL. Information on How To Enable session state in a C# Web service is located at the following link.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstatemanagementinaspnetwebservices.asp
Best of luck
Forever Developing
|
|
|
|
|
Hello,
I have created a Dll by ATL and I want
to #import it in my MFC App.
How can I use the classes inside my DLL?
Best Wishes,
Thanks.
|
|
|
|
|
|
Some years ago I was fourced to write a VB program that required TAPI support for data modem. Well now I have to fix it since the PDQTapi control has a bug in it that crashes crashes (closes) the program when the a HangUp command is issued (On Win2000/XP). I have written a C++ class to replace it and am writing an ActiveX control (using ATL) as a drop in replacement.
Problem (in VB): PlaceCall(varControl,szPhone As String)
PDQTapi.PlaceCall(PDQCom,szPhone)
Questions:
1) What argument (PDQComm) type do I specify to allow a control to be passed to the new control.
2) There is anouther method that can take any control type as long as it has a SetItem method.
My ATL 3.0 COM book does not seem to have the answer, but I am still looking there and on the net.
Thanks for any help you can give.
TaTa!
INTP
|
|
|
|
|
I just realize that it is probably a VARIANT or VARIANTARG.
INTP
|
|
|
|
|
Yup. Typically, you QI the control for IUnknown or IDispatch, and set the variant type accordingly (VT_UNKNOWN, VT_DISPATCH).
Steve S
Developer for hire
|
|
|
|
|
Hi, I have a dll that runs in the address space of Explorer. (Shell extension)
So i do not have a main app, just a dll. I could use either MFC or ATL.
My problem is i need to know when a Windows Shutdown event is being fired. I've never had this problem before because all my apps have a main window and receive this notification. However the dll just keeps working and terminates in an undetermined state.
I can't have the dll called from an app. I have no alternative but to use what i've got.
how can i register to receive a WM_SHUTDOWN event from my dll?
Please don't suggest i change the design of the solution. I'm confined to what i have.
thanks in advance
Carl
|
|
|
|
|
You may try to use a Windows hook - WH_GETMESSAGE or WH_CALLWNDPROC and monitor WM_ENDSESSION message.
Just a thought...
|
|
|
|
|
Igor, where were you yesterday?
That's exactly what i did and it gives me the desired notification. - thanks.
I would be interested in another method though if you have any thoughts.
Kind Regards
Carl
|
|
|
|