|
it's very long story...
i want to save progID in XMLDOM attribute when i have only pointer to interface and than create object using this progid from XMLDOM file.
ISQ 469907496
|
|
|
|
|
vippavlo wrote: it's very long story...
I'll leave it for tomorrow, heading home in few minutes
vippavlo wrote: i want to save progID in XMLDOM attribute when i have only pointer to interface and than create object using this progid from XMLDOM file.
What about COM DLLs that support only DispInterface?
Is this so called pointer passed to you by external application or it's created in your own application?
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
/*What about COM DLLs that support only DispInterface? */
What you mean??
ISQ 469907496
|
|
|
|
|
|
It's you sorry me, maybe i said somthing wrong? because i dont know english perfect - my grammar is bad
I'm know perfect what is mean "IDispatch" ))) I don't understand your question, what you whant to tolk with this words about DDL's - what's problem with DDL's??????
I was not read you last sentence sory ....
It's a component for SDK - it save program settings to XML file and one of parameters can to be an interface and i put into XML properties of this object and want to put ProgID for in future create object using this ProgID.
Now i have this code and it work without some p'roblems, but if some other compiler, VisualBasic for example, generate type lib with another way.... it will not be working.....
Where m_spObj - its smart pointer CCOmPtr, for example...
CComPtr<itypeinfo> spTypeInfo;
UINT uiCount = 0;
GUID guidOfInterface;
hr = m_spObj->GetTypeInfo( 100, LOCALE_SYSTEM_DEFAULT, &spTypeInfo );
TYPEATTR *pattr1 = NULL;
hr = spTypeInfo->GetTypeAttr( &pattr1 );
guidOfInterface = pattr1->guid;
CComPtr< ITypeLib > spTypeLib;
hr = spTypeInfo->GetContainingTypeLib( &spTypeLib, &uiCount );
uiCount = spTypeLib->GetTypeInfoCount();
CLSID clsidOfCoclass;
for( UINT i = 0; i < uiCount; i++ )
{
CComPtr< ITypeInfo > spTI;
hr = spTypeLib->GetTypeInfo( i, &spTI );
TYPEATTR *pattr = NULL;
hr = spTI->GetTypeAttr( &pattr );
if( pattr->typekind == TKIND_COCLASS )
{
clsidOfCoclass = pattr->guid;
}
if( pattr->typekind == TKIND_DISPATCH )
{
if( guidOfInterface == pattr->guid )
{
CComBSTR bsCLSID;
ProgIDFromCLSID( clsidOfCoclass, &bsCLSID );
m_bsProgIDName = bsCLSID.Detach();
spTI.Release();
spTypeLib.Release();
spTypeInfo.Release();
return S_OK;
}
}
spTI.Release();
}
spTypeLib.Release();
spTypeInfo.Release();
return hr;
ISQ 469907496
|
|
|
|
|
vippavlo wrote: It's a component for SDK - it save program settings to XML file and one of parameters can to be an interface and i put into XML properties of this object and want to put ProgID for in future create object using this ProgID.
Now i have this code and it work without some p'roblems, but if some other compiler, VisualBasic for example, generate type lib with another way.... it will not be working.....
I think you should be allowed to insist that such objects support an appropriate IPersist interface. I recall that the plain IPersist interface has just one method which returns the class ID.
The reason that you can't use the type info for this is because there can be any number of COCLASSes in the type library that implement the interface. There is no provision for doing what you want in that case.
Nathan
|
|
|
|
|
Hi All
I need to know how i can to have the all id controls (HTML Controls) in the Page by using javascript
how can help me
thanks for any body help me
Thaer
|
|
|
|
|
Please do not cross post. Choose appropriate forum.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Dear All
I need to make an ocx to be container to RICHTX32.OCX special using VB 6 or Vb.net
text prop
DataSource Prop
DataField Prop
any tips for that ?????
thanks
bye
|
|
|
|
|
I'm trying to do some Powerpoint automation from an ASP.NET page and generate/modify a slide. That piece of the code works fine but when it's all done running and even after I call the Quit() method on the powerpoint application object, POWERPOINT.EXE remains running and eventually this is causing problems. I've googled this extensively and nothing I've found has seemed to help. I really need this to work properly.
Here's my relevant code. I don't believe i'm using any Global references and I've even removed the COM reference from my website to use Late Binding instead in hopes that it would solve my problems as mentioned in this MSDN Article: http://support.microsoft.com/default.aspx?scid=kb;en-us;319832
Code:
Public Function GenerateDrillDown(ByVal strFileName As String) As Boolean<br />
Dim App As Object = Nothing<br />
Dim pres As Object = Nothing<br />
Dim slide As Object = Nothing<br />
<br />
Try<br />
App = CreateObject("PowerPoint.Application")<br />
App.Visible = -1 ' For debugging. Comment this out or set to 0 to keep the application from being visible.<br />
<br />
pres = App.Presentations.Open("C:\DevProjects\Docs\DrillDown.ppt", 0, -1, -1)<br />
slide = pres.Slides(1) ' There's only one slide in this ppt i'm using as the template.<br />
<br />
slide.Shapes.Item("Text Box 8").TextFrame.TextRange.Text = DecisionTitle ' These are all string variables<br />
slide.Shapes.Item("Text Box 13").TextFrame.TextRange.Text = Narrative<br />
slide.Shapes.Item("Text Box 14").TextFrame.TextRange.Text = Issues<br />
slide.Shapes.Item("Text Box 19").TextFrame.TextRange.Text = Scope<br />
<br />
If TopicType = 1 Then<br />
slide.Shapes.Item("Autoshape 9").TextFrame.TextRange.Text = IDNumber.ToString()<br />
slide.Shapes.Item("Autoshape 9").Visible = -1<br />
slide.Shapes.Item("Autoshape 56").Visible = 0<br />
ElseIf TopicType = 2 Then<br />
slide.Shapes.Item("Autoshape 56").TextFrame.TextRange.Text = "ST" & IDNumber.ToString()<br />
slide.Shapes.Item("Autoshape 56").Visible = -1<br />
slide.Shapes.Item("Autoshape 9").Visible = 0<br />
End If<br />
<br />
pres.SaveAs(strFilename, 1, 0)<br />
Catch ex As Exception<br />
Return False<br />
Finally<br />
' Most of this is coming from another article I found online to help combat the problem of open references with office automation.<br />
GC.Collect()<br />
GC.WaitForPendingFinalizers()<br />
GC.Collect() ' Intentionally repeated<br />
GC.WaitForPendingFinalizers() <br />
If Not slide Is Nothing Then<br />
Marshal.FinalReleaseComObject(slide)<br />
slide = Nothing<br />
End If<br />
<br />
If Not pres Is Nothing Then<br />
pres.Close()<br />
Masrhal.FinalReleaseComObject(pres)<br />
pres = Nothing<br />
End If<br />
<br />
If Not App Is Nothing Then<br />
App.Quit() ' This doesn't do anything, no errors but ap stays open<br />
Marshal.FInalReleaseComObject(App)<br />
App = Nothing<br />
End If<br />
End Try<br />
<br />
Return True<br />
End Function
Please give me some guidance as this is an important piece of functionality required by my project. Thanks!
|
|
|
|
|
Hi,
I have a problem with pinvoke in c# trying to create a VST host.
A VST host is a little program able to use a dll which is actually
an audio effect applicable on a wave file. The dll exports only
one function : main. When you call this function it returns a
pointer to a structure that lists the capabilities of the
particular audio effect.
My problem is that whatever I try, I just can't get the pointer
that the dll is returning. I know that the call works because
I supply a Delegate to the function which in turns calls the function
in my program.
Is there anyone out there who has tried something similar or who
is a master of Interop who can help me on this topic?
Jean
|
|
|
|
|
A couple of months ago I wrote an application that acts as a host for the Cakewalk DXi Audio Plug In. The source is entirely different from the VST, but the Plug In concept is similar. Both the VST and the DXi are written as unmanaged COM Dlls (you know this, obviously). So, naturally, writing a host is alot easier in an unmanaged language.
The easiest approach is to convert your VST Plug In to a NET assembly by using the Type Library Import Utility (tlbimp.exe[^]) shipped with SDK. This creates an assembly that you can then reference and use directly with your host application.
A better approach would be to write your host in Unmanaged C++; sometimes the function types generated by the Type Library Import Utility are just too cumbersome to use easily.
You might read this: Importing a Type Library as an Assembly[^]. I'm assuming that the VST DLL contains a type library. If not, you'll have to write your audio host in unmanaged C++ (unless you want to write your own Runtime Callable Wrappers, which is a very tedious and error-prone process; if you are a novice at Interop, I wouldn't recomment it).
Good Luck.
-- modified at 17:18 Thursday 25th October, 2007
|
|
|
|
|
http://vstnet.codeplex.com
VST.NET allows you to write a VST host in managed code (C#/VB.NET). Check out the Host sample that is available. VST.NET will take care of all the marshaling between unmanaged and managed code so you do not need to call P/Invoke's. Note that VST.NET only supports VST 2.4.
VST.NET also supports writing VST plugins.
|
|
|
|
|
while registering registry i am getting it is succeded but when i am going to search the CLSID of the same it doesnt gives...whats wrong here???
shailesh
|
|
|
|
|
verify your search settings - specifically, shorten your search string....
Charlie Gilley
Will program for food...
|
|
|
|
|
Search by the guid u used for the component.
Prasann
who else
|
|
|
|
|
Dear Shaileshvb,
If you get it success while registering .... I guess you are trying to search the CLSID manually. If so ... then have tried searching it by selecting cmd --->RegEdit ---> Edit ---> Find ---> Enter the CLSID you are searching for ....
Thanks,
Arindam D Tewary
|
|
|
|
|
Name your price... as God is my witness, I hate anything to do with the web...
I have an activeX control in VC++. I want to call it from VBScript. This activeX control
has properties (they work fine). It also as get/set methods. The set's work fine. I cannot seem
to find the right mojo to return a value from the activeX control... I know VBScript's calling convention is VARIANTs only. Fine.
So, what arguments do I pick for my method so that I can return a value? In straight C++, I would pass by reference or by pointer.
If I call from VBScript:
DIM myInteger
call myCtrl.getValue(myInteger)
I want my C++ code to drop something into a data structure such that VBScript actually receives the results. Anyone willing to trade a code snippet for a case of beer? Flowers in the event you're a lady? Not to be sexist, but if you want the beer, I'm good with that too
Charlie Gilley
Will program for food...
|
|
|
|
|
Since you need to use a script language, to obtain values from (as well to pass values to) the ActiveX control you need the control to implement the IDispatch interface (automation, my dear) and to use automation-compatible types as methods parameters. The following link point my article that shows how LicenceProvider COM component implements a method supporting automation
[^].
The relevant code is inside LicProvider::Provide that you may find in the LicProvider.cpp source file.
BTW if it helps, don't forget the beer!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
Since you're using MFC, maybe worthy a look at http://msdn2.microsoft.com/en-us/library/95357zak(VS.80).aspx[^]
Bottom line, if it is useful, send the beer to Mummy Microsoft!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
If your "getValue" method has [retval] attribute, you can write:
DIM myInteger<br />
myInteger = myCtrl.getValue<br />
With best wishes,
Vita
|
|
|
|
|
Vita,
Yes, thank you, I know this. But what I want to know is how to do this (example):
DIM nStatus
DIM nWhatever
nStatus = myCtrl.DoSomething(nWhatever)
and .DoSomething returns a value in nWhatever....
chg
Charlie Gilley
Will program for food...
|
|
|
|
|
It's possible for VBScript, for example, but is never possible for JScript.
1) [out] parameter should be VARIANT*.
2) else there should be the Invoke handler be able to convert VARIANT with VT_VARIANT|VT_BYREF to obtain any type. I didn't met such default handlers.
With best wishes,
Vita
|
|
|
|
|
Hello,
I developed a simple browser helper object in VC++ as an ATL project which listens for the DocumentComplete event of the DWebBrowserEvents2 interface.
When testing it I discovered that this event is not fired if the user presses the reload button.
Why is that? And what is the proper event which is fired, when the document is loaded and is fired again, when the document is reloaded?
Thanks for your attention.
Constantin
|
|
|
|