|
QueryInterface() ???
but you got to know which object to ask for. I guess the aprrobiate doc/window...
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
I am trying to make a touchscreen friendly skin in ms Access 07. Things are going well, but I hit a road block. What I dont know how to do is get access to add a track to a user playlist called "Controller".
If anyone is feeling particularly helpful, heres what the whole event should be. What vba code will
1. delete what ever tracks happen to be in user playlist "Controller"
2. add the recordset to user playlist "Controller"
3. Start playing user playlist "Controller" starting with me.songname.
If anyone could help me with any part of this, that would be much appreciated!
|
|
|
|
|
Why does this give a syntax error????
Private Sub SongName_Click()<br />
<br />
Dim pl As IITUserPlaylist<br />
Dim song As IITTrackCollection<br />
Dim upl As IITTrack<br />
<br />
pl.AddTrack (song(me.SongName),upl.Playlist("Controller"))<br />
<br />
End Sub<br />
|
|
|
|
|
after successful cocreateinstance. When i access a method in class it returns the error:
"First-chance exception in XYZ.exe (OLEAUT32.DLL): 0xC0000005: Access Violation".
By step by step debugging i found it gives this error while calling
// make the call
SCODE sc = m_lpDispatch->Invoke(dwDispID, IID_NULL, 0, wFlags,
&dispparams, pvarResult, &excepInfo, &nArgErr);
in OLEDIST2.CPP file.
please help
|
|
|
|
|
hi,
could you please be more specific on this?
1) check you called the CoInitialize() and the component is register in the machine and the instance is created properly.
2)check the component created and being accessed are on the same thread.
^-^
@|@
- redCat
|
|
|
|
|
Hi,
i checked coInitialize and cocreateinstance they return successfull...
How could i check wheter the component created and being accessed are on same thread?
please help.
|
|
|
|
|
Did you check always HRESULT return values?
Could you please post the relevant code?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi
this is the code segment:
CLSIDFromString(L"{AF684922-D245-11D3-8DE8-00A024ACAB85}", &CLSID_MSDiscMasterObj);
CLSIDFromString(L"{AF684924-D245-11D3-8DE8-00A024ACAB85}", &IID_IDiscMaster);
hr = CoInitialize(NULL);
if(SUCCEEDED(hr))
{
hr = CoCreateInstance(CLSID_MSDiscMasterObj, NULL, CLSCTX_LOCAL_SERVER, IID_IDiscMaster, (void**)&IV2WObj);
if(SUCCEEDED(hr))
{
VARIANT ReturnValue;
ReturnValue = IV2WObj->MakeConnection(1,"VPCI",65536,0);
}
}
it fails at method call.
CoInitialize successful,
cocreateinstance is also successful.
the COM object is obtained as an executable.
Which is sucessfully launched after executing cocreateinstance.
please help
|
|
|
|
|
try sending the second parameter as widechar L"VPCI" or as BSTR.
and if the last parameter is string, do not send as 0. try sending NULL or empty string L"".
^-^
@|@
- redCat
|
|
|
|
|
Hi redCat,
Actually there are around 10 to 20 member functions in that class. I couldn't able to call any one of the functions. even the one which doesn't have any arguments.
The probable reason seems to me is like the class object pointer returned by cocreateinstance(returns successfully) is accessing a memory location which is not part of the process memory area. But iam not sure. even if this is the problem i don't know how to resolve it?.
please help
|
|
|
|
|
Some updates which i verified.
I could check the typelib registration process in REGISTRY and found it to be perfect according to the procedure shown @ link :
http://blogs.msdn.com/larryosterman/archive/2006/01.aspx
"Minimal COM object registration"
"COM registration for cross process access"
"COM registration if you need a typelib"
"COM registration of PROGIDs."
"What registry entries are needed to register a COM object."
but still the problem persists
please help
|
|
|
|
|
You call your function with bad parameters. Make correct bstr and so on.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi all,
thanks for your time.
the problem is solved at my end.
Problem lies in importing the type library (tlb) of the COM server in to my client application. Because of which, object gets a corrupted pointer. when a member function is called it gives ACCESS VOILATION error.
I actually imported the typelibrary in my Visual C++ application using "CLASS WIZARD" as mentioned @ MSDN link:
http://msdn.microsoft.com/en-us/library/aa279228(VS.60).aspx
Which actually caused the above problem.
Later I found by importing typelibrary using simple #import "xyz.tlb"
it generates two files .tlh and .tli files which also contains all the classes and member function definitions.
When i used these files in my project it worked.
Sorry for bothering you......
thanks and regards
sandeep r.
|
|
|
|
|
Hi everybody, this is my first post on this forum.
I am trying to find a way to call a constructor of my managed (C#) class registered as a COM object
(with regasm gacutil etc ...)
I can build an object calling:
<br />
HRESULT hr = CoInitialize(NULL);<br />
MyNamespace::IMyClassIntf l_myObject;<br />
l_myObject = MyNamespace::IMyClassIntf(__uuidof(MyNamespace::IMyClass));<br />
I suppose this calls my managed class's the constructor without parameters.
Is there a way to call a constructor with parameters.
Reguards.
|
|
|
|
|
write in an init(...) function. Doing "stuff" in a constructor is a bad idea. Try to reduce it, because error handling and exceptions are really a pain for that.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
KarstenK, thanks for your answer,
does it mean it's impossible ?
In the end I did it this way.
But sometime you need to pass arguments to object's constructor:
An object <A> wich works only with another object <B> has no reason to exist without <B>.
So In my way, <B> should be passed as argument in <A>'s constructor.
|
|
|
|
|
I dont know.
But the problem of verification of the parameters or error/exception handling in the constructor is a minefield. And also timing: for instance connecting to a remote host, which doesnt answer?
The same is also valid for deconstructors: "Dont do stuff!"
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
No it doesn't tell me if it's possible or not.
I understand that "doing stuff" in constructors should be avoided, but for me it's not a valid answer
It doesn't matter anymore, I used an init function anyway. It was just in order to clarify my mind.
I think it's much worse to do stuff in destructors than in constructors, especially when you use your class as COM object, you can't be sure when your object will be destruct (Probably on the CoUninitialize call).
It's much better to use a Finalize method. But that was not the question.
Thank you anyway KarstenK.
If someone come with something over this point, it would be nice.
|
|
|
|
|
Sorry for the double post, but I didn't get any love on the C# forum, thought I'd try my luck here.
Please could someone point me in the right direction. I've written an ActiveX control in C# and it's working well except for one "small" problem. I'm trying to access the ambient properties of the ActiveX container and am drawing blank.
I'm trying to replicate the following VB 6.0 functionality in C#:
Ambient Properties:
ActiveXAmbientMode = UserControl.Ambient.UserMode
Ambient Properties changed event:
Private Sub UserControl_AmbientChanged(PropertyName As String)
If PropertyName = "UserMode" Then
' Do Stuff Here
End If
End Sub
From what I can find out so far is that this "might" have something do to with implimenting the IOLEControl COM interface? But I can find NO examples of this ever being done? Anyone ever managed to get this working because I can't find any useful info on this anywhere?
|
|
|
|
|
BUMP for any feedback? Does anyone know if this is even possible?
This has nothing to do with UserControl.Site.DesignMode, because that doesn't get exposed to COM. So will always return FALSE when the ActiveX is used in an application.
I'm looking for the COM interface implimentation of how a VB 6.0 ActiveX interacts with it's container....
|
|
|
|
|
Did you ever get an answer on this?
|
|
|
|
|
Hello!
There is interface IWebBrowser2, which I use to get IHTMLDocument2, IHTMLElementCollection, IHTMLElement, IHTMLImgElement from.
I can get different picture options from IHTMLImgElement, but I can't get the picture itself.
How can I do that? Please advise.
P.S.
I've tried to use the following code:
IOleCommandTarget* pCT;
CComVariant vGlyphTableEntry;
vGlyphTableEntry = "c:\\temp.jpg";
if (pElemDispatch->QueryInterface(__uuidof(IOleCommandTarget), (void**)&pCT)==S_OK)
{
pCT->Exec(&CGID_MSHTML, IDM_SAVEPICTURE , OLECMDEXECOPT_DONTPROMPTUSER ,&vGlyphTableEntry, 0);
pCT->Release();
}
But this code shows the 'Save as' dialog, which shouldn't appear. What's wrong with this code? Is there some other way to do that?
Thanks in advance
|
|
|
|
|
Take a look at IHTMLElementRender which you should be able to query the IHTMLImgElement for. This interface has a DrawToDC method that you could use to render the element to a DC of your own creation.
|
|
|
|
|
I want to write a program which checks present available wireless networks through my wireless application ,
and to ping message to all the networks to check their availability..... i think i have use aodv concept but dont no how to start .... pls help in getting start ...
Thanks for any suggestion ....
|
|
|
|
|
I am trying open a excel file after downloading it from website, but its giving error "Missing file: C:\default.css?5".how can i overcome the error thru C#.
Thanks
Senz
|
|
|
|