|
gehbitte wrote: does this Virtual OS completely has it's on COM Server funcionality or does it use the COM technique from the original OS?
virtual OS has it's own COM servers - it is completely separate!
Think - the virtual OS could be Linux, with no COM at all!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Hello everyone,
I have written a small test application. The application is splitted into two parts. The first part is written in unmanaged C++ using ATL. It creates a normal window in which a .NET control will be loaded using the class ATL::CAxWindow. Besides two interfaces (IExtensionInfo, ITreeItem) and TreeItem coclass are defined in the library.
The second part is a C# class library containing one UserControl. The C# part references the type library from the part written in C++.
Here is an small overview.
C# Part: class Extension : UserControl, IExtensionInfo
C++ Part:
class CMainWindow
class CTreeitem : ITreeItem
And here is the IDL code for the interfaces.
interface ITreeItem : IDispatch
{
HRESULT AddChild(void);
HRESULT GetChildCount([out,retval] LONG* pChildCount);
};
interface IExtensionInfo : IUnknown
{
HRESULT GetCaption([out, retval] BSTR* caption);
HRESULT SetCaption([in] BSTR caption);
HRESULT Init([in] ITreeItem* ipTreeItem);
HRESULT Unload(void);
};
Now we came to the core part: Creating the C# control and host it in a container; Creating a TreeItem object and passing the interface pointer to the C# part.
When the Init method is not called to pass the interface pointer to the C# control then everything is doing just fine. But when it is called then the application remains in memory after the window is closed.
LRESULT CMainWindow::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
HRESULT hr;
_AtlModule.Lock();
this->m_pCtrlWindow = new CAxWindow();
RECT rect;
this->GetClientRect(&rect);
HWND hControlWindow = this->m_pCtrlWindow->Create(this->m_hWnd, rect, NULL, WS_CHILD | WS_VISIBLE);
IUnknown *pUnknownControl;
hr = this->m_pCtrlWindow->CreateControlEx(L"CsControlInNativeWindow.Extension", NULL, NULL, &pUnknownControl);
this->m_spExtensionInfo = pUnknownControl;
if (pUnknownControl)
{
pUnknownControl->Release();
}
this->m_spTreeItem.CoCreateInstance(CLSID_TreeItem);
this->m_spExtensionInfo->Init(this->m_spTreeItem);
return 0;
}
LRESULT CMainWindow::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
if (this->m_spTreeItem)
{
this->m_spTreeItem.Release();
}
if (this->m_spExtensionInfo)
{
this->m_spExtensionInfo->Unload();
this->m_spExtensionInfo.Release();
}
if (this->m_pCtrlWindow)
{
this->m_pCtrlWindow->DestroyWindow();
delete this->m_pCtrlWindow;
this->m_pCtrlWindow = NULL;
}
_AtlModule.Unlock();
return 0;
}
I hope someone can tell me how I can make that the application shuts down.
Best regards.
|
|
|
|
|
Hi all,
I am developing an online dictionary using asp.net 3.5, C# and SQL SERVER; I want to add speech capability to this application. now I found "Interop.HTTSLib.dll" suitable for this, but there is a problem: this application works fine locally but does not work in a remote host and I get this error: " Retrieving the COM class factory for component with CLSID {2398E32F-5C6E-11D1-8C65-0060081841DE} failed due to the following error: 80040154."
Does the kind of server(x86 or x64, 32bit or 64bit) make this problem or asp.net authorization is the main reason? I am using www.aspspider .com (free asp.net hosting) as my host.
Here is my C# code:
protected void Button1_Click(object sender, EventArgs e)
{
string temp = TextBox1.Text.Trim();
HTTSLib.TextToSpeechClass speech = new HTTSLib.TextToSpeechClass();
speech.Speak(temp);
}
Finally how I can fix this problem, I am really thankful for any help.
|
|
|
|
|
That error == REGDB_E_CLASSNOTREG - see what it says about it in CoCreateInstance[^].
Is your test-to-speech library installed into the remote host?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
When you perform speech.Speak on your local machine, does it just play the audio directly? Have you got a second PC you can test from (connect to the web server on your main PC using a browser on another PC) - try again - does the sound play from the PC running the server?
If you try and use this on a real server, you'll be trying to play the audio on the server side, which probably doesn't even have a sound card installed. You'll need a text to speech engine that outputs to an audio file which you can stream to the client instead.
|
|
|
|
|
Hi All,
I have a com dll which i want to use without registering it so is it possible? i tried it this way but while trying to call its functions i am not getting its reference....
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
|
Well, It will works on development enviroment, but so far i know, good practics is to use RegAsm.
Thanks
Md. Marufuzzaman
|
|
|
|
|
I have trouble in getting Scanner and Camera wizard started to import pictures from a removable
Device(such as USB mass storage) through API. Could someone give me some direction?
I know Wia.AutoplayHandler.1 is the one do the job, but I don't know how shell uses Wia.AutoplayHandler.1 and then I don't know how to simulate shell to call it.
In general, when user plug in a MSD device, windows will pop up a Autoplay dialog, and when user select import, a import wizard will pop up. What I need to do is to popup this import wizard dialog and tell the wizard the path(as g:\) where to import, then the wizard will show pictures in the MSD device to user.
The component HKEY_CLASSES_ROOT\WIA.AutoplayDropHandler.1 looks like the thing the wizard uses. But I still don't know the right way to use it as shell does.
|
|
|
|
|
Hi,
I Created one Activex control in c#.net.i assigned stong name to assambly,i registered the assembly,created setup and created the cab file and compiled.
i created one asp.net web application and added Html page and call the activex method in onload using object tag by using javascript.i'm using ie7 to run the application.browser throwing error immediatly as 'Object doesn't support this property or method' i enabled the options in Tools -> InternetOptions -> Security -> Custom level -> enable the Download un signed Activex controls and intialize the unsafe scripting too.
please provide me solution to solve my issue.and how to run the activex control by using iis.how to use the .cab zip file.am struggling alot from long time.plz..plz.. how your will helps me alot..
thanks in advance
krishna
|
|
|
|
|
Hi
Are you sure you added ClassInterfaceAttribute to your class like the sample below?
<br />
using System.Runtime.InteropServices;<br />
<br />
[ClassInterface(ClassInterfaceType.AutoDispatch)]<br />
public class MyClass<br />
{<br />
public MyClass() {}<br />
}<br />
<br />
ClassInterfaceType.AutoDispatch is required if you wanna your class be accessed through a script.
|
|
|
|
|
Hi, still am getting same error sither for the ClassInterface(ClassInterfaceType.AutoDual) or
ClassInterface(ClassInterfaceType.AutoDispatch).if we updated the class of activex control is it required to do create the strong name to the assembly,register the assembly and create the cab file again.
thanks and regards,
krishna
|
|
|
|
|
I'm doing C# interop with Direct3D (I know about SlimDX and XNA so let's not get into the merits of this) and I'm calling D3DX10CreateMesh passing it my ID3DX10Mesh interface. I'm getting an error saying "No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))". The D3DX10CreateMesh call comes while I am trying to create a 10 mesh to copy a 9 mesh into (after successfully loading an x file). I've looked at my C# definition of the ID3DX10Mesh and it follows the same structure as every other working interface I've defined.
But then I noticed something. The Guids for the 9 and 10 meshes are *exactly* the same (4020E5C2-1403-4929-883F-E2E849FAC195). I've double checked the d3dx9mesh and d3dx10mesh headers and this is the case. The 9 mesh interface works but the 10 doesn't (This maybe be instantiation-order dependent) I personally don't understand this as it would imply that even in C/C++ apps you couldn't use the two meshes together but we know that you can. I've seen it done in NVUT SDK. I can only think that the Runtime Callable Wrapper is getting confused byt the Guids?
Why would the mesh guids be the same (seems ridiculous to me) and how are C/C++ apps able to avoid the conflict?
PS. I've posted this in the COM forum because the problem is COM not Direct3D.
modified on Thursday, July 16, 2009 9:56 AM
|
|
|
|
|
Klempie wrote: Why would the mesh guids be the same (seems ridiculous to me) and how are C/C++ apps able to avoid the conflict?
Yes, I believe this is normal. DirectX10 is backwards compatible with DirectX9. Only new/incompatible interfaces will have new guid.
Best Wishes,
-David Delaune
|
|
|
|
|
That's just the thing though. The methods on the two interfaces are completely different so I'm not sure how they would be compatible. It looks like I will be forced to do what I need to without using the 10 mesh.
|
|
|
|
|
If the methods on the ID3DX10Mesh are completely different from the DX9 version (differing signature parameters, causing it to be incompatible at the binary level), then it seems ridiculous that GUIDs would be the same (as Don Box would say, it violates the basic precept of COM). And, since, I can't imagine the Microsoft DirectX Team screwing up something that obvious and simple, there MUST be another rational explanation.
Anyway, it's good to know,...I'll stick with DirectX 9,...I understand it.
|
|
|
|
|
Yup. The methods do not match up parameter wise, nor do they even match up in terms of implied functionality from the naming.
|
|
|
|
|
I want to know which window message is generated when a volume is inserted, i.e when i insert card in memory card reader's slot an autorun dialog box appears it means there must be some message that is generated when i insert memory card in the slot, I have tried WM_DEVICEARRIVED and also WMI Win32_DeviceChangeEvent but they get fired when I insert the reader into USB slot not when i change the card, but window shows auto run dialog box i want to know that low level window message that is generated when i insert or remove card form slot not the whole card reader.
sssssssss
|
|
|
|
|
|
Hello guy, you can try WM_DEVICECHANGE message, and RegisterDeviceNotification() may be useful, good luck!
|
|
|
|
|
I have a couple of questions about developing an out-of-proc (local) COM server using ATL.
I need to figure out how to make the server function as a single instance. Currently, any call by a client app to CoCreateInstance will launch a new instance of my server. Is there a macro or define that I am missing?
I am also having trouble getting QueryInterface to work properly on an exposed class. I can only get a IUnknown ptr to my object. If the client calls QueryInterface to get a different interface, I can see via traces (from defining _ATL_DEBUG_INTERFACES and _ATL_DEBUG_QI) that the QI call on my object (in the exe) succeeds, but but the refcount is only going to 1, then QI succeeds, then release is called, dropping the refcount back to 0. (I am using the singleton class factory.) The call in the client is returning E_NOINTERFACE.
I would appreciate any ideas or suggestions on where to get help.
Thanks.
Wayne
|
|
|
|
|
to get your server to be a single instance you need to modify the call to RegisterClassObjects to
hr = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_SINGLEUSE);
|
|
|
|
|
hi
I m working on this issue from months but not found a appropriate solution yet.
I had made a customized website on ASP.NET 2.0 my website.My requirement is when ever the client login to my site a(Com)dll has to registerd in his system automatically.
Can anybody suggest me the right solution for it??
how do I able to register that dll to the client end that access my website
I be highly obliged
Thank u
sandhya
|
|
|
|
|
Take a look at the tutorial - How to add ActiveX content to your web pages[^]
By automatically register, if you mean the component must be registered without notifying the user, that is a matter of security settings at the client.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|