|
Hi,
I am posting here cos none answers in ATL group.
I have a dialog box in my ATL exe, I want to use/link a C Library. AFter clicking OK button on the dialog on of C functions should execute .
How to do this. linking the Clibrary and opening the C function.
marcoslav
-- modified at 3:10 Friday 16th June, 2006
|
|
|
|
|
extern "C" should work, I believe
|
|
|
|
|
Hi,
I have some problem with this fn.
IMultiMediastream::GetDuration(..);
but this fn. worked well
IMultiMediastream::SetState(STREAMSTATE_RUN);
how to solve this problem
|
|
|
|
|
I need to marshall an interface to a apartment threaded component.The component has type library marshalled interface(oleautomation).
I plan to use CoMarshalInterThreadInterfaceInStream/CoGetInterfaceAndReleaseStream(IStream) based marshalling ,but it cannot be sent across as void*(not automation-compatible datatype).
Is there some way to marshall this interface without using GIT?
|
|
|
|
|
rana74 wrote: it cannot be sent across as void*(not automation-compatible datatype).
What does this mean?
"across" what?
If you mean across apartment boundaries it doesn't matter whether the interface is automation compatible or not.
If it's an interface method that takes an interface pointer it should be passed as an IDispatch* if the interface is automation compatible which means it should not be cast into a void*.
What are you trying to do/call that requires a void*?
rana74 wrote: Is there some way to marshall this interface without using GIT?
Sure, CoMarshalInterThreadInterfaceInStream/CoGetInterfaceAndReleaseStream is the way to do it.
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Hi all,
I have customized controls for button(ownerdrawn), listbox, listctrls, etc. They were intended for MFC applications. They are working fine in MFC dialogs in ATL.
But when they put directly in ATL composite control, there are many painting problems. Button is not getting painted (a gray rectangle can be seen). List box and list control are painted as default.
What could be wrong? Or is there any limitation between ATL and MFC connectivity?
- NS -
|
|
|
|
|
NS17 wrote: What could be wrong? Or is there any limitation between ATL and MFC connectivity?
Have you tried the REFLECT_NOTIFICATIONS() macro in your message map?
--
100% natural. No superstitious additives.
|
|
|
|
|
Jörgen Sigvardsson wrote: Have you tried the REFLECT_NOTIFICATIONS() macro in your message map?
Yesterday there were some progress... Yes, I used REFLECT_NOTIFICATIONS() macro. I read in MSDN that there is some changes in messages. For eg., instead WM_DRAWITEM there is OCM_DRAWITEM, etc. So I tried to map this message to drawing function in Button class. Then the button worked fine.
Now my doubt is that,can I map all these OCM_ functions permanently? I need to use the controls in both MFC and ATL based applications without changing the code.
Thank you.
- NS -
|
|
|
|
|
Can't you just have two handlers (eg. for WM_DRAWITEM and OCM_DRAWITEM) that point to the same function?
You can dig around atlwin.h to see how the reflections are done.
OCM_DRAWITEM = WM_DRAWITEM + OCM__BASE
|
|
|
|
|
OK. I understood. I have to try it. Thank you.
- NS -
|
|
|
|
|
How do I find out which version of ATL and WTL is installed on a System? Is there a way?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
WTL can't be installed, it's just header files.
For ATL, you can look at the version of atl.dll. But apps can be compiled with ATL code staticly linked, so again there's nothing that is installed.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Michael Dunn wrote: WTL can't be installed, it's just header files.
So How do I know which version of ATL and WTL I am using or is present on the System?
Michael Dunn wrote: But apps can be compiled with ATL code staticly linked
How do I achieve it?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
TechyMaila wrote: So How do I know which version of ATL and WTL I am using or is present on the System?
Oh, you mean when compiling. Ok, the versions are in the _ATL_VER and _WTL_VER symbols.
Use the MinDependency build targets to staticly link ATL.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
If you use ATL control containment you need "ATL.dll" even if your statically linking.
Steve
|
|
|
|
|
I code this, but no use?
why?
How to add Timer in activex ?
BEGIN_MSG_MAP(ClistSample)
MESSAGE_HANDLER(WM_TIMER, OnTimer)
END_MSG_MAP()
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
return 0;
}
alantop
|
|
|
|
|
I believe you will need a Window to get timer messages. It doesn't work in window-less controls.
1- You could use the Multimedia timer.
2- Or you could just create a hidden window that would receive the timer messages.
3- Or create a thread that sleeps for the specified amount of time, and calls a function of your program. (quite inaccurate timing).
this is this.
|
|
|
|
|
You need to start the timer.
UINT nMilliseconds = 1000;
::SetTimer(hWnd,ID_TIMER,nMilliseconds,NULL);
when finish stop it with
::KillTimer(hWnd,ID_TIMER);
|
|
|
|
|
hi,
i've a view on which i have some CComboBox, and 1 CComboBoxEx (class extending CComboBox with some cool things).
i'm setting the background color and the text color of the CComboBox by handling WM_CTLCOLOR messages, and here is some code:
LRESULT MyView::onCtlColor(UINT , WPARAM wParam, LPARAM , BOOL& ) {<br />
HDC hDC = (HDC)wParam;<br />
<br />
::SetBkColor(hDC, WinUtil::bgColor);<br />
::SetTextColor(hDC, WinUtil::textColor);<br />
<br />
return (LRESULT)WinUtil::bgBrush;<br />
};
this does color all the controls of my view succesfully, except the CComboBoxEx ! For this control, the background is set on the whole control except behind texts; moreover, the texts don't get colored. Here is my problem, if anyone has some clues, it would be great ! (since Google didn't have any )
|
|
|
|
|
Hi All,
I want to create a button on a HTML page. When I am clicking the button, it should trigger the Browser Helper Object event, and should execute the code written inside the BHO event. BHO events written in VC++ ATL.
Expecting your valuble suggestion.
|
|
|
|
|
Plz. help me for debugging the project.
The error occured is:
"Error while trying to run project:Unable to start debugging on the web serever side error on sending debug HTTP request."
Reply me.
ok
|
|
|
|
|
I am using a tab control, into which I am inserting a dialog which contains several subclassed edit controls. If I press the tab key from one of the edit controls, the focus is set to the tab control, and not the next edit control.
Any ideas?
Thanks in advance
|
|
|
|
|
if not, how to use thread in the activex ?
alantop
|
|
|
|
|
AfxBeginThread is an MFC function. If you're using MFC then you can use this; if not use beginthread or beginthreadex (CRT) or CreateThread (Win32). Unless you know what you're doing prefer the CRT functions.
Steve
|
|
|
|
|
The CRT functions are required if you're going use the CRT library (these functions initializes the CRT for each new thread). A fact which I was not aware until recently.
--
100% natural. No superstitious additives.
|
|
|
|