|
could I say that if I build a compnent used by VBScript and other script language,the parameter should be dedined VARIANT
|
|
|
|
|
For out-parameters, that is a good strategy I'd say, as script languages are often weakly typed.
--
Weiter, weiter, ins verderben.
Wir müssen leben bis wir sterben.
I blog too now[^]
|
|
|
|
|
Hello everybody.
After importing an ATL DLL in a mfc app
I want to use the Interface to use methods and
Others. OR I want to declare a variable from Interface to use .
Best Wishes,
Thanks.
|
|
|
|
|
Assuming you mean '#import' this will give you .tlh/.tli files.
These define wrapper classes (unless you use an option to switch these off) inside a namespace (unless you use an option to turn this off).
You need to declare an instance of one of the wrappers, use either raw CoCreateInstance or the wrapper's version to get the appropriate object instantiated and get back the interface. You can then use the methods via your object.
Typically, being retro, I use raw interfaces, and declare mine using
CComPtr<imyinterface> spObj;
but then, I'm old fashioned, I like to see error values myself, rather than having exceptions thrown.
Steve S
Developer for hire
|
|
|
|
|
|
Hi,
I'm not entirely sure whether the two things are related, but I'm pretty sure I've read articles here in the past on it but can't find them now.
Effectively I want to build a small app that will give me a text box and a button inside my taskbar that will link in to Google desktop, enabling me to put search items straight in without having to fire up IE first. Effectively it'll just launch IE with a particular URL, with the search terms I enter.
Anyway, I was wondering if anyone can point me in the right direction, or indeed let me know whether any such utilities already exist?
Thanks,
--
Paul
"Put the key of despair into the lock of apathy. Turn the knob of mediocrity slowly and open the gates of despondency - welcome to a day in the average office."
- David Brent, from "The Office"
MS Messenger: paul@oobaloo.co.uk
Download my PGP public key
|
|
|
|
|
|
Great, thanks. Now I just have to set aside some time tonight and give it a go.
--
Paul
"Put the key of despair into the lock of apathy. Turn the knob of mediocrity slowly and open the gates of despondency - welcome to a day in the average office."
- David Brent, from "The Office"
MS Messenger: paul@oobaloo.co.uk
Download my PGP public key
|
|
|
|
|
I want to change the Active Directory User's state icon. And I have added a new icon to user class, but I don't know how to set the current state to expect state.
example: If my icon state is 3, how to set the user state to 3?
|
|
|
|
|
I want to change the Active Directory User's state icon. And I have added a new icon to user class, but I don't know how to set the current state to expect state.
example: If my icon state is 3, how to set the user state to 3?
|
|
|
|
|
Hi Everybody
Does anybody know how to override the GetWindowProc method? I want to handle some specific messages in my own window procedure and direct the others to the base WndProc.
Regards Roozbeh.
|
|
|
|
|
1. You do not need to override GetWindowProc(), it can be done in the PreTranslateMessage() like so:
virtual BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_COMMAND)
OnCommand(true);
return FALSE;
}
2. If you still want to do it, here is an example how to override a GetDialogProc(), hope it's helpful:
DLGPROC CMyDlg::GetDialogProc()
{
return MyDialogProc;
}
INT_PTR CALLBACK CMyDlg::MyDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
CNoteDlg * pThis = (CNoteDlg*)hWnd;
_ATL_MSG msg(pThis->m_hWnd, uMsg, wParam, lParam);
const _ATL_MSG* pOldMsg = pThis->m_pCurrentMsg;
pThis->m_pCurrentMsg = &msg;
LRESULT lRes;
BOOL bRet = pThis->ProcessWindowMessage(pThis->m_hWnd, uMsg, wParam,
lParam, lRes, 0);
if (DEFERDELETE == pThis->m_bAutoDelete && pOldMsg == NULL)
{
delete pThis;
return FALSE;
}
ATLASSERT(pThis->m_pCurrentMsg == &msg);
pThis->m_pCurrentMsg = pOldMsg;
if(bRet)
{
switch (uMsg)
{
case WM_COMPAREITEM:
case WM_VKEYTOITEM:
case WM_CHARTOITEM:
case WM_INITDIALOG:
case WM_QUERYDRAGICON:
case WM_CTLCOLORMSGBOX:
case WM_CTLCOLOREDIT:
case WM_CTLCOLORLISTBOX:
case WM_CTLCOLORBTN:
case WM_CTLCOLORDLG:
case WM_CTLCOLORSCROLLBAR:
case WM_CTLCOLORSTATIC:
return lRes;
break;
}
::SetWindowLong(pThis->m_hWnd, DWL_MSGRESULT, lRes);
return TRUE;
}
if(uMsg == WM_NCDESTROY)
{
HWND hWnd = pThis->m_hWnd;
pThis->m_hWnd = NULL;
pThis->OnFinalMessage(hWnd);
if (pThis->m_bAutoDelete)
{
if (pThis->m_pCurrentMsg == NULL)
delete pThis;
else
pThis->m_bAutoDelete = DEFERDELETE;
}
}
return FALSE;
}
|
|
|
|
|
Thanks a lot for your help.
Regards Roozbeh.
|
|
|
|
|
Hi all !
I was assigned a task which I don't think is possible to do.
What I was requested to achieve is basically the following:
To cause our existing MFC (Doc/view) application to become a COM EXE server !
Is it possible at all, or am I wasting my time. If it's not possible, what approach shall I take?
I used the information which appeared under the article :
Article ID :175190
Last Review:June 29, 2004
Title : How to add ATL support to an MFC EXE
Link : http://support.microsoft.com/default.aspx?scid=kb;EN-US;175190[^]
Outcome so far : NOT Successful, meaning, the registration is not failing, but the server cannot be found by a client application (class not registered !)
As far as I understand , the article 175190 discusses the option of
embedding an "local In-process COM server" into the application, not a "remote COM EXE server".
I tried everything I know, so far with no results..
Please help,
Rubi
|
|
|
|
|
Please go to :
http://www.codeproject.com/script/comments/forums.asp?forumid=1648&exp=0&select=986387#xx986387xx
Rubi
effic
|
|
|
|
|
Hi everybody,
I have created an MDI application with WTL Application Wizard. I want to handle some command messages (such as those generated when a user selects a menu item) in the active mdi child window. Since these messages are captured by the mdi main frame window, I think I should route these messages to mdi child window procedure and therefore override the mdi main frame's WndProc.
Am I right? If so how can I reach this method?
Would you please get me the answer in details with code?
Thanks in advance.
Yours Roozbeh.
|
|
|
|
|
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]
|
|
|
|