|
Will third party browsers load a BHO too?
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
Help me. !I have an exercise:
Build an Active X that allow communicate with COM Ports:
-Allow user choosing port (COM1, COM2, COM3, COM4)
-Allow setting parameters: speed, parity, data bit, stop bit…
-Have methods: Open, Close, Flush ports
-Have method: Send & Receive data (char or string) through ports
-Allow setting time for end of transfer data (time-out transfer)
-Allow setting time for testing port (loop-back tested time)
-Auto enabled when there's an event from ports.
Can you help me ! (I use VC++)
Hung Son
Hung Son
|
|
|
|
|
Hi ,
Can someone tell me how to use MFC classes, like
CPropertySheet in ATL EXE.
Thanks,
Sansky
God is Good, all the Time.
All the Time, God is Good.
|
|
|
|
|
There's such a function in VBScript as TypeName which returns the coclass name of the passed object.
How to do the same using:
- JScript
- Compiler COM Support Classes (C++)
- API (C++)
?
tx
(H) Serge
|
|
|
|
|
TypeName return the type of the variant which was passed as argument. To do the same in C++ check the vt member of the VARIANT data ( it can be VT_BSTR, VT_I4, VT_BOOL, etc)
|
|
|
|
|
Hi,
When i try to access IADsWInNTSystemInfo interface, i am getting "undeclared
identifer" error. I have included the Iads.h file, but the file doesn't contain
the interface. Where will i get the latest header file. Anbody help??
Thanx,
Sangeetha.
|
|
|
|
|
I would look in the different versions of Platform SDK.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
The version which i downloaded from Microsoft site is ADSI SDK version 2.5. I am not able to find any updates or fixes. Please do keep me posted on this.
Thanx,
Sangeetha.
|
|
|
|
|
Hello I had created an Activex component
I try to create it dynamically with :
Set MyTotoObject = CreateObject("TotoViewOCX.TotoView")
In this cas I can only acces the function of my object I can not access
the extender functions.
So I can not displaying it.
I try another method:
Set MyTotoObject = MMI.Controls.Add("TotoViewOCX.TotoView", "MyToto")
With this mode I can only acces the extender methods, And I can displaying it.
but I need to use the function I have created.
Is it possible to create the object and displaying it with the possibility
to Use the functionnality i add inside
Thanks a lot Michael
|
|
|
|
|
Try to use the typelib while creating the control and then use the New keyword to instantiate it. First set a reference to the control. then create it
Dim obj as new MyProject.MyActiveXControlClass
Set obj = new MyProject.MyActiveXControlClass
obj.CallMethod
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
Hi all,
In my server implementation, I have the following code:
// Create a new CComEnum<> of IUser* interfaces
typedef CComObject< CComEnum<ienumuser, &iid_ienumuser,=""
="" iuser*,="" _copyinterface<iuser=""> > > EnumUser;
EnumUser* pNewEnum = NULL;
EnumUser::CreateInstance(&pNewEnum); // This is the line with error
However, when I tried to compile my server, I receive the following:
error C2259: 'CComObject<class atl::ccomenum<struct="" ienumuser,&struct="" _guid="" const="" iid_ienumuser,struct="" iuser="" *,class="" atl::_copyinterface<struct="">,class ATL::CComSingleT
hreadModel> >' : cannot instantiate abstract class due to following members:
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(4403) : while compiling class-template member function 'long __stdcall ATL::CComObject<class atl::ccomenum<struct="" ienumuser,&struct="" _guid="" const="" iid_ienumuser,struct="" iuser="" *,
class="" atl::_copyinterface<struct="">,class ATL::CComSingleThreadModel> >::CreateInstance(class ATL::CComObject<class atl::ccomenum<struct="" ienumuser,&struct="" _guid="" const="" iid_ienumuser,struct="" iuser="" *,class="" atl::_copyinterface<struct="">,class AT
L::CComSingleThreadModel> > ** )'
I have IEnumUser declared in the server idl file, and IUser declared in a separate dll.
Does anyone know what I have done wrong? Your help is much apprepriated.
Sunny
|
|
|
|
|
Sorry, the error message got cutoff. It should be:
error C2259: 'CComObject<class atl::ccomenum<struct="" ienumuser,&struct="" _guid="" const="" iid_ienumuser,struct="" iuser="" *,class=""
atl::_copyinterface<struct="">,class ATL::CComSingleT
hreadModel> >' : cannot instantiate abstract class due to following
members:
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h
(4403) : while compiling class-template member function 'long __stdcall
ATL::CComObject<class atl::ccomenum<struct="" ienumuser,&struct="" _guid=""
const="" iid_ienumuser,struct="" iuser="" *,
class="" atl::_copyinterface<struct="">,class
ATL::CComSingleThreadModel> >::CreateInstance(class
ATL::CComObject<class atl::ccomenum<struct="" ienumuser,&struct="" _guid=""
const="" iid_ienumuser,struct="" iuser="" *,class="" atl::_copyinterface<struct=""
iuser="">,class ATL::CComSingleThreadModel> > ** )'
|
|
|
|
|
I call CoInitialize(NULL) in a DLL, and after some processing, I call CoUnitialize in the same DLL. This causes the app using the DLL to crash (rather spectacularly) in another un-related part of the code.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
When that ocurss I prefer to use the CoInitialize and the CoUnitialize out of the DLL, before and after to call the function into the dll
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
I tried moving the CoInit/CoUninit to the class in the app that actually uses the DLL.
COM has to be available the entire time that the DLL lives in the program space because I have interfaces that might persist between calls to the DLL's functions.
There is truly strange stuff happening.
It might even be better if I called CoInit in OnInitInstance in the app instead.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Isn't it recommended to call CoInitializeEx(). I have had problems with CoInitialise() before and changing to ...Ex may help.
Dave.
|
|
|
|
|
Did you freed all the interface references?
E.g. YourInterface->Release(), or if you are using smart pointers, setting them to NULL?
I have seen a crash before when I forgot to free all the references before I called CoUninitialize().
Hope it helps,
Sunny
|
|
|
|
|
Hi,
I have stumbled across a problem again, and this time, it is on retrieving an element from a SAFEARRAY. The following code shows what I am trying to achieve:
// Creates a user
IUser* pUser4 = NULL;
CoCreateInstance( __uuidof( User ), NULL, CLSCTX_INPROC_SERVER,
IID_IUser, (void**)&pUser4 );
// Store my first name into it
pUser4->put_FirstName( L"Sunny" );
// Creates a variant that contains an array of type IUnknown pointers
_variant_t* userArray = new _variant_t;
userArray->vt = VT_ARRAY | VT_UNKNOWN;
// Create the array
SAFEARRAY* pSA;
SAFEARRAYBOUND bounds = { 1, 0 };
pSA = SafeArrayCreate( VT_UNKNOWN, 1, &bounds );
// Turn my pUser4 pointer into the IUnknown pointer
IUnknown* pUnk = NULL;
pUser4->QueryInterface( IID_IUnknown, (void**)&pUnk );
// put the IUnknown pointer into the array, and store the array
// into the variant
long a = 0;
SafeArrayPutElement( pSA, &a, pUnk );
userArray->parray = pSA;
// Retrieve the element
SAFEARRAY* ans = userArray->parray;
IUnknown* pUnk2 = NULL;
SafeArrayGetElement( ans, &a, pUnk2 ); // problem occurs
IUser* pUser5 = NULL;
pUnk2->QueryInterface( IID_IUser, (void**)&pUser5 );
BSTR first;
pUser5->get_FirstName( &first );
//======================== END
The problem arises when I tried to get the IUnknown pointer from the array by calling SafeArrayGetElement. I looked at the debugger, and it showed that the address of pUnk2 is 0x00000000.
I am wondering if anybody known what I have done wrong?
Help is apprepriated
Sunny
|
|
|
|
|
I'm not sure the problem is that but I know if you want to access the buffer of SAFEARRAY ,after you create it you have to use SafeArrayAccessData() method,and after you finished working with it you have to
use SafeArrayUnAccessData() .
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Hi,
I'm using ::OleCreate to activate an Excel worksheet (Excel.Sheet) in-place in an MDI child window. The problem is I want to control the out-of-process server instance (Excel.Application) that is instancing the worksheets.
The default Windows behviour seems to either create the Excel.Sheet instances from whichever server was launched first, or just creates a new server if no server is activated.
Does anyone know of a way of specifying which server the out-of-process object is created in?
Many thanks in advance.
|
|
|
|
|
Hi !
I'm building an App using Visual Basic 6, where I would like to display many ActiveX controls.
The number and types of ActiveX to display is not hard-coded in the App, but rather put in a text file that would be read during initialization of the App, thus allowing me to add/remove ActiveX controls without recompiling my App.
My problem is I don't know how to use an ActiveX control in VB without registering it (Project->Component) and putting it into a form. I would like to register it during code execution and placing it into my form dynamically.
Anyone knows how to do that ?
Thank you for your help !
Jerome
|
|
|
|
|
Jerome C wrote:
I would like to register it during code execution and placing it into my form dynamically
First , normally, you must always register the COM object.
Second you're are talking perhaps about late binding ...
So you can declare something like this:
dim x as object
'read file, retrieve the progid of the class
set x = CoGetObject("",progid)
or
'read the name of class to instancing
set x = CreateObject("myClass.xpto")
If you want really to register you must deal with reg* api , like RegSaveKey or RegSetValue ..., for instance placing all the registries entries on the text file per object and using the registry keys to save the values ..., or writing a reg file for each object and call the ShellExecute api to automatically merge the .reg file, and so on ... you get the idea ...
Cheers,
Joao Vaz
|
|
|
|
|
What does that error (STG_E_MEDIUMFULL) mean?
The message is 'Not enough storage is available to complete this operation.' still it has nothing in common at all with the real problem. What can cause such a message and how to fix it up?
The code is (error-handling omitted):
StgCreateDocfile(L"Image.bmp", STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, &pStorage);
pStorage->CreateStream(L"Image.bmp", STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE, NULL, NULL, &pStream);
Image->QueryInterface(IID_IPersistStream, (void**)&pPersistStream);
OleSaveToStream(pPersistStream, pStream);
* Origin: Silence Must Be Heard (2:5030/744.235)
|
|
|
|
|
Can I control the IE browser by using a COM?
is there a example?
thanks!
|
|
|
|
|
Check MSDN / Platform SDK / Web development / Internet SDK / Reusing browser technology.
|
|
|
|
|