|
How do we draw ActiveX window (visible ActiveX) on to a window using "win32 SDK"(I mean not using Microsoft Foundation Classes !)?
Thanks and Best regards,
Deepu
|
|
|
|
|
Hi,
Probably you mean you want to host ActiveX control in your Win32 Application. Right?
Hosting a control without support of MFC is very hard to implement.
Try to search PATRON sample from MSDN. It's a sample used in book "Inside OLE" by Kraig.
It has no reliability to any librarys like MFC or ATL. Cause of the purpose of the sample,
it has little support as a container.
BTW, if you don't mind using ATL, try to use CAxWindow or something like that.
That control hosting support class template. It's very useful to host a control.
IMHO ATL which has very readable source compared to MFC, is something worth to work on
as a Windows programmer.
Essentially about ATL, I recommend to read the book "ATL Internals" by Chris Sells.
Hope this helps.
Regards,
Ryan
|
|
|
|
|
first call OleInitialize(NULL) (but off course you know that)
Then create the Object and get its LPDISPATCH, or it's interface pointer.
If necesary, Invoke any method of the interface for loading documents or initializing.
Query the OleInPlaceObject interface and set the object rectagular.
RECT Pos={0,0,500,400},Clip={0,0,500,400};
OleInPlaceObject->SetObjectRects(&Pos,&Clip);
When you want to paint it , query the IViewObject interface and call the 'draw' method.
RECTL rectl={0,0,250,200};
ViewObject->Draw(DVASPECT_CONTENT,-1,0,0,0,(HDC)hdcDraw,&rectl,0,0,0);
I use this in a CGI i am making where i just want to take a
quick snapshot of Adobe's SVG control.
I will generate SVG files using CF or ASP, then renter them
using SVG control, encode them to JPG using CGI+ and sent them
to the client!
In the same pattern you can use a control founded in Corel draw
that generates barcodes.
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
Hi, I'm working with a composite control in Visual C++...
Among other things I have a button on the dialog..
The problem is that I can't get it to react on me pressing the enterbutton.
I've tried overloading the pretranslatormethod but that doesnt work so good....
HELP
|
|
|
|
|
Does anyone have a sample that uses OleCreateFromData() function?
Or can anyone tell me the details of using it?
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
hi, would like to know how to realize resizing a window MPlayer
Called in VBapp with the help COMinterface, generated with the help ATL (VC ++ VS 6.0)
Thanks
|
|
|
|
|
Good afternoon, I would like to know how to realize sending definite events
Through a given time slice for example in VBapps, if it is necessary COMinterface with ATL (VC ++ VS 6.0) to realize. The value of an interval of sending should be set with the help Property ,i.e it to transmit VBapps.
I give thanks for advices
|
|
|
|
|
Appears so;)
I would like to know as to realize the Com-interface for control Mediaplayerîì in environment VC ++ with ïîìîøüþ for example ATL (for VBapps). In MSDN there is an example of implementation where it is possible Play, Stop, Reset- "Funktionen" and path to Avi or MPG for the file to call. I would like to add a capability of reproduction from a definite position of film,, forward and back from THIS position, transition to first and last to staff(frames). And also definite staff forward and back, the temporary coordinates for this listing should be transmitted with events To today I only has created a function Play (double Ze) through parameter by which one transmits value of a position. But as âñ ¸ it in link.. I do not represent: ((it be necessary Property-Variable to insert that the flow bundle was between these functions..
Thanks by All for advices
|
|
|
|
|
Hi together
I despaired almost. I tried a ATLMOVIE-example from MSDN to represent. But it was not possible to me ((
Again and again as I by means of ATLWISARD uner VS6.0 vc ++ have created, then testkotainer has invoked, at last I direct a filename - property(VT_BSTR) something to and invoke kclickte, it drops with ((. But (however) in " the original - proggi " something to select. Probably I put aside money that falch at Ertsellen either AtlObjekt or AltProjekt.aber What???
I require it that the project with events to create, and I do not know as to consisting ATLOBJEKT Events add
Thanks by All for advices
|
|
|
|
|
I have a local COM server that must not die when there are no more reference
to it and I don't want it to be a service. To do this I made sure that the
reference counter never reaches 0. To accomplish this I tried several
things:
1. Use CoAddRefServerProcess() at startup.
2. USe CoLockObjectExternal at startup.
3. Modify CModuleExe::Unlock so the lock count only reaches 0 if allowed.
When I use any of these 3 methods (which probalby all do the same: make sure
the ref. counter does not reach 0) my component stays alive, but it will
free a lot of memory. I saw my component of 1.7 MB go to a mere 60 KB .
I figured I would see a slight decrease of memory use as it does not need the proxy/stubs anymore. But this seems a bit radicale.
Does anyone know what happened?
Is there a beter way of making sure a component stays alive when tere are no more
references to it?
Regards,
Brian.
|
|
|
|
|
How do we extract the custom errors which are embedded in the HRESULT variable?
|
|
|
|
|
|
Could you explain more!?.I did not find any help in how to use these macro in MSDN?Could you help me out?
thx deepu
|
|
|
|
|
That is how resizing a ATL control inside the ATL server DLL? The detail is: I
set a ATL control property with Width and Height and want resize the control
according to the two parameters. Please tell me how can I get it?
cz
|
|
|
|
|
Hi
have you tried SetWindowPos() ?
Hush..Hush.. thought I heard you calling my name now...
|
|
|
|
|
Yes, I have do it by SetWindowPos. Just after I call this function, the ATL extenter
has been resized(become smaller). But I click in the original rect of the ATL extenter,
the ATL become the original size as same as before calling SetWindowPos.
In fact I want to call SetWindowRgn to make a irregular ATL control, but I cannot
because the same reason as above. Click the ATL, it become back to previous shape.
cz
|
|
|
|
|
After FormatMessage( ) how do I convert lpMsgBuf to a BSTR? Thanks.
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL
);
// Convert lpMsgBuf to BSTR
|
|
|
|
|
Use the ATL string conversion macro T2BSTR.
#include <atlconv.h>
{
USES_CONVERSION;
BSTR bstr = T2BSTR(lpMsgBuf);
...
} The memory allocated for the BSTR is freed whenever the block is exited.
--Mike--
http://home.inreach.com/mdunn/
The Signature, back by popular demand: Buffy. Pajamas.
|
|
|
|
|
If you are using MFC you can use:
CString::AllocSysString() but remember that you are allocating a new OLE style string which may need to be cleaned up with ::SysFreeString().
Alternatively you could use ATLs CComBSTR object which will clean itself up like a CString.
Cheers.
John Curtis.
Software guy.
Fatlab Software.
|
|
|
|
|
you can use ::SysAllocStringByteLen()
char* pLcID;
:SysAllocStringByteLen(pLcID,sizeof(pLcID));
|
|
|
|
|
I am using dual interface to expose the functions of the COM interface.One of the function takes the handle of window as the parameter.
I need to use the Invoke()method to call the function and pass the parameter.Could you please help me with some kind of sample code ?
Thanks
Jafer
Jafer
|
|
|
|
|
I'm new to COM and ATL and I'm trying to produce a simple component that will serve collections of other COM objects.
I've created my COM object, LoginUser and tested it with VB - all OK.
I've created my COM collection for LoginUser objects and tested it with VB - all OK. (I am using David Petersons collection wizard).
What I am unable to do is add LoginUser object to the collection in VC++. I get the collection back with the correct number of items but all of the items appear to be uninitialised. Can anyone tell me how to do this. I've appended a snipet of my code in case anyone can tell me where I've gone astray and how to fix it.
STDMETHODIMP WASP::GetUsers( IWASPrecordset **pUser )
{
HRESULT hr;
IWASPrecordset *pR = NULL;
// Start COM subsystem
CoInitialize( NULL );
// Create a recordset object,
hr = CoCreateInstance ( CLSID_WASPrecordset,
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(IWASPrecordset),
(void**) &pR );
// Did we succeed
if( SUCCEEDED(hr) )
{
for( i = 0; i < 10; ++i )
{
ILoginUserInt *pU = NULL;
// Create a LoginUser object,
hr = CoCreateInstance ( CLSID_LoginUserInt,
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(ILoginUserInt),
(void**) &pU );
// Did we succeed - put user details into login user object
if( SUCCEEDED(hr) )
{
_bstr_t bst( "James" );
// Put user name into user object
pU->put_User( bst );
// Now put object into collection
pR->Add( pU );
// Release my copy of this object
pU->Release();
pU = NULL;
}
}
// Now set the return value to be the new object
pR->QueryInterface(__uuidof(IWASPrecordset),(void **) pUser);
// Release my copy of the object
pR->Release();
pR = NULL;
}
// Stop COM subsystem
::CoUninitialize();
return hr;
}
Thanks
Nic.
|
|
|
|
|
I have some COM components. I want to write an application in VC++6 using them.
What should i do? Do I have to change any settings for vc?
|
|
|
|
|
Not specifically. Just import your server's typelib and call methods/ connect to events etc..
Hush..Hush.. thought I heard you calling my name now...
|
|
|
|
|
Hi Is there anybody, who knows how I can create an ActiveXControl in another ActiveXControl.
It could work with 'CreateControl' , but I don't know how!!!!
Please help me as fast as you can!!
thank u
|
|
|
|