|
Hi,
Please suggest regarding following trouble:
Create a COM component "InProcVB.dll" as in-proc DLL in VB exposing some interfaces and methods .
Write its client as "clientVB".
Write another COM component as "OutOfProc.exe" as out-of-proc exe server in VC. This has same
interface/class/InterfaceIDs/ClassIDs as that of "InProcVB.dll". This is written with purpose of
replacing "InProcVB.dll". And, the expectation is that client need not re-compile. (As defined by
rule "Location transparency of COM).
After developing "OutOfProc.exe", we unregistered "InProcVB.dll", and registered "OutOfProc.exe".
Executed "clientVB" without any change. It gave error type-mismatch. The error point was:
Dim objSrvClass as SrvClass
set SrvClass = CreateObject("Server.Class") --> Problem: Type mismatch.
If I change code as
Dim objSrvClass as Object
set SrvClass = CreateObject("Server.Class")
It works well.
Please suggest.
|
|
|
|
|
Hi there,
Anybody knows how to programmatically set the "Minutes until idle shutdown:" value in the Advanced Tab?
Ideas or link is highly appreciated.
CK
"Computers are like Old Testament gods; lots of rules and no mercy." -JosephCampbell
|
|
|
|
|
Anyone know where theres some good info on the audio side of DirectX?
I've read and understood most of the stuff that comes with the SDK, but are there any tutorials on using DirectX in say an audio sequencer?
Ta
|
|
|
|
|
|
I've created a COM component and now I want to install it. I've wrapped it up in an installable package using InstallShield. I can then choose to uninstall it using the Add/Remove software utility. If I want to uninstall it from another I write some code to unregister it like this:
HINSTANCE hModule = LoadLibraryA(szModuleFilename);
HRESULT (STDAPICALLTYPE *pfn)(void);
(FARPROC&)pfn = GetProcAddress(hModule, "DllUnregisterServer");
I can then delete the DLL and it's containing folder but that's not really satisfactory is it?
What's the best way of doing it? I guess there must be a way of emulating the call to the Add/Remove utility and I guess this is probably the best method. Anyone know how or have an opinion?
|
|
|
|
|
One solution is to run regsvr32.
Kuphryn
|
|
|
|
|
That's just the same as calling the code that unregisters the DLL - it doesn't uninstall the package. Say I had installed my COM server using InstallShield which had also created some registry entries, simply calling regsvr32 or the code above would result in the COM component being no longer registered but the registry entries would still exist and anything else that had been installed as part of the package like the containing folder etc.
|
|
|
|
|
Hi ,
I am searching for a good sample code or article that takes a tab delimited file as input and imports it prograamatically in an access database.I don't want to loop through all the records in the text file and then put them individually into access.I want to import the whole file programmatically into an MS ACCESS table.May be it requires OLE.
Any help will be appriciated.
Thanks and regards.
|
|
|
|
|
Hi,
BUlk insertion is not possible in MS Access, but u can do it in Sql Server, just chk out the documentation of BULK INSERT in MSDN, and use _ConnectionPtr to connect to datasource using ADO.
best wishes..mil10
|
|
|
|
|
I've been trying to add a new interface to my application, and for some reason, I keep getting the following error:
C2504: IWWAlmDBAck : base class undefined
I defined a new interface in an IDL file, and IWWAlmDBAck is using IUnknown.
I declare the interface in a header file, underneath a class called CWWAlmDBPrg, declaring it as public IWWAlmDBAck.
The error is pointing to the header file, saying that the base class is undefined. However, there are old interfaces defined under CWWAlmDBPrg, and no errors generated from that. Why is it when I add a new one, the error occur?
Below is my header code:
This is where I got the error, at IWWAlmDBACK
class CWWAlmDBPrg :
public IWWAlmDBConnection,
public IWWAlmDBInfo,
public IWWAlmDBTable,
public IWWAlmDBProviderSession,
public IWWAlmDBQuery,
public IWWAlmDBDetailed,
public IWWAlmDBConsolidated,
public IWWAlmDBCause,
public IWWAlmDBComment,
public IWWAlmDBDefaultQuery,
public IWWAlmDBTagStatus,
public IWWAlmDBEvents,
public IWWAlmDBErrorInfo,
//New Interface:
public IWWAlmDBACK,
public CComObjectRoot,
public CComCoClass<cwwalmdbprg,&clsid_wwalmdbprg>
{
public:
CWWAlmDBPrg()
Below is code from my IDL:
This is where I defined the interface IWWAlmDBACK:
//New
[
object,
uuid(2D65B748-6B53-45e5-A201-74D072F39045),
helpstring("IWWAlmDBACK Interface"),
pointer_default(unique)
]
interface IWWAlmDBACK : IUnknown
{
[helpstring("method LogAlmAckConsolidated")] HRESULT LogAlmAckConsolidated([in] int AlarmId,[in,string] wchar_t* AckTime,[in] int AckTimeFracSec,[in] int AckTimeZoneOffset,[in] int AckDaylightAdjustment,[in] int OutstandingAcks,[in] int AckCommentId, [in,string] wchar_t* AckOperatorName,[in,string] wchar_t* AckNodeName, [in] double User1, [in] double User2, [in,string]wchar_t* User3, [in] long Cookie);
};
//End New
I generated the uuid using guidgen.exe
I defined the interface in coclass:
coclass WWAlmDBPrg
{
[default] interface IWWAlmDBConnection;
interface IWWAlmDBInfo;
interface IWWAlmDBTable;
interface IWWAlmDBProviderSession;
interface IWWAlmDBQuery;
interface IWWAlmDBDetailed;
interface IWWAlmDBConsolidated;
interface IWWAlmDBCause;
interface IWWAlmDBComment;
interface IWWAlmDBDefaultQuery;
interface IWWAlmDBTagStatus;
interface IWWAlmDBEvents;
interface IWWAlmDBErrorInfo;
//New
interface IWWAlmDBACK;
};
Thank you!
|
|
|
|
|
The only thing I can think of is to make sure the interface is defined before it is used (i.e., defined before CWWAlmDBPrg) and that the header is included in the source file in which its used. Also, perhaps recompiling the IDL file before building the project would help. I had a similar problem once where the IDL file wasn't getting compiled automatically during the build, and I had to manually do it before the build process.
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
Hi,
The IHTMLDocument2 interface has the method get_images(), which supposedly returns the images found in the document. But trough that interface I can only access the attributes concerning the images (e.g. height, width, border etc.).
So my question can I access the actual image data from somewhere. From IHTMLDocument2 or from some other related interface. I'm developing an ActiveX component which needs to alter images on pages.
"There is no reason for any individuals to have a computer in their home". Ken Olson, president and founder of Digital Equipment Corp.
|
|
|
|
|
There doesn't seem to be any way of doing this, short of hosting the WebBrowser control (or MSHTML) and handling the markup and rendering yourself, which I'm betting isn't an option.
Intead, what about displaying the image in your ActiveX control. That way, it would have exclusive control over the display of the image. MSN Photos used to have a print wizard that worked similar (they probably still do, but they went to strickly subscription-based usability so I can't use it anymore).
You could still get certain images on the page by getting their src attribute and downloading and displaying in your ActiveX. Just an alternative suggestion.
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
Yep, I was also thinking about, taking the src of the image and then downloading it again and so. Though it is kind of stupid to download the images two times, so I was hoping for an easier solution.
But I quess I have to live with this ... Thanx
|
|
|
|
|
You don't actually have to download it twice. Use the moniker functions like IE does like URLDownloadToCacheFile , which even gives you callback. The file is pulled from the cache based on the browser's cache settings. You can also bind an image to the URL moniker directly, which is how IE / Windows usually handles things. This, agian, should be under the control of the cache settings.
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
That sounds good. at least better than downloading the images twice. I'll have to try that.
Thnx again for your answer
|
|
|
|
|
i wrote a EXE server.registered the dll and exe. when i am running my client program it throws an error that required interfaces are not implemented.
the client is a standard OPC client, it only detects the IConnectionPointImpl
default interface.the other custom interfaces are not detected by the client.
what may be the cause.
cheers
satish
|
|
|
|
|
I have a query regarding component versioning.
I had a component named "Old_VC_Exe_Component" exposed as an STA, out-of proc COM server, developed in VC++. This is for our internal use and not for client.
"Old_VC_Exe_Component" is wrapped by another component "Old_VB_Dll_Component_Wrapper" which is in-proc COM server developed in VB, and this is exposed as SDK to client.
Now we are planning to provide new version of our product.
In new version, we are thinking of removing the wrapper layer. That is we want to expose "Old_VC_Exe_Component" to client (as "New_VC_Exe_Component") instead of "Old_VB_Dll_Component_Wrapper".
We can change server code at server end. And the requirement is that, client of "Old_VB_Dll_Component_Wrapper" SDK should not be required to make any change in his code, when we replace "Old_VB_Dll_Component_Wrapper" by "New_VC_Exe_Component".
Can you tell me is this possible? Or what can be the possible issues in doing this?
|
|
|
|
|
Yes, of course. Your new component should have the same CLSID (or ProgID, translated into necessary CLSID) and the same set of interfaces as the old DLL-component.
There is a "location transparency" rule in COM. Look at MSDN for more information about this.
With best wishes,
Vita
|
|
|
|
|
Thanks. I am facign following trouble:
Create a COM component "InProcVB.dll" as in-proc DLL in VB exposing some interfaces and methods .
Write its client as "clientVB".
Write another COM component as "OutOfProc.exe" as out-of-proc exe server in VC. This has same
interface/class/InterfaceIDs/ClassIDs as that of "InProcVB.dll". This is written with purpose of
replacing "InProcVB.dll". And, the expectation is that client need not re-compile. (As defined by
rule "Location transparency of COM).
After developing "OutOfProc.exe", we unregistered "InProcVB.dll", and registered "OutOfProc.exe".
Executed "clientVB" without any change. It gave error type-mismatch. The error point was:
Dim objSrvClass as SrvClass
set SrvClass = CreateObject("Server.Class") --> Problem: Type mismatch.
If I change code as
Dim objSrvClass as Object
set SrvClass = CreateObject("Server.Class")
It works well.
Please suggest.
|
|
|
|
|
I have no problem at all.
I made the VB's Server.dll, VC's Server.exe and testing Project1.exe. Tested object has one method xxx in VB server
Public Sub xxx()
MsgBox "xxx subroutine is called"
End Sub
and in VC server
STDMETHODIMP CClass::xxx()
{
MessageBox(NULL,"ATL xxx is called", "ATL", MB_OK);
return S_OK;
}
and testing code in Project1 project
Sub Main()
Dim x As Server.Class
Set x = CreateObject("Server.Class")
x.xxx
End Sub
When i register some COM server, I have relevant message: if VB, then VB, if VC, then VC. I.e.
>regsvr32 Server.dll
>Project1.exe
Having ... xxx subroutine is called
>regsvr32 /u Server.dll
>Server.exe -RegServer
>Project1.exe
Having ... ATL xxx is called
>Server.exe -UnRegServer
There is no magic. It's possible that you have a mistake. I also firstly made a mistake - I have mixed up the coclass and interface IDs. And I had "Type mismatch"
With best wishes,
Vita
|
|
|
|
|
Thanks for your efforts. Can you please send us the code of both VB and VC server and client samples that you have written?
This will help us in locating problem at our end.
Regards.
|
|
|
|
|
Just wondering if anyone has done any study into the speed of COM? In particular, a comparison of the time taken to access a COM object's methods with a locally defined object's methods.
In my application I have put all of the ADO functionality into a COM object, however, it's really slow to query the database (through the COM object) and then display the results. I am considering using a simple C++ class instead, since there is only one application accessing the database anyhow.
Any comments or ideas on this would be really helpfull.
|
|
|
|
|
You need to answer following before perfromace measurement:
What is type of your server? out-of-proc/in-proc?
What interfaces are you using? Dispatch/Dual?
What is the frequency of clietn server interaction?
|
|
|
|
|
Here are the results of the test, performed on NT4SP3, Pentium Pro 300Mhz, 128Mb RAM, and a 10Base-T network connection:
Early Bound Late Bound Cached
In Process 20 ms 90 ms 80 ms
Out of Proc 1952 ms 5137 ms 2944 ms
Remote 14952 ms 36403 ms 20089 ms
|
|
|
|
|