|
|
Hey,
I'm using late binding for Excel and I have problem with calling Open (Workbooks) method.
Some other method (properties) work just fine (I'm using Office XP).
Code:
<br />
objWorkbooks = excel.GetType().InvokeMember("Workbooks",BindingFlags.GetProperty, null, excel, null);<br />
<br />
object[] oParam= new object[13];
oParam[0] = FileName;<br />
for(int t=1; t < parameters.Length; t++)<br />
oParam[t] = Type.Missing;
<br />
objWorkbooks.GetType().InvokeMember("Open",BindingFlags.InvokeMethod, null, objWorkbooks, oParam);<br />
<br />
And exception is: "Additional information: Exception has been thrown by the target of an invocation."
Tnx for helping me.
Nice day,
David
|
|
|
|
|
plz tell me how to access a dll on a server from a client side VB application
I am able to access ASP service from vb app. through SOAP
but how to do this with .dll
plz help
Thanks in advance
|
|
|
|
|
I want to specify a sound card for windows media player but keep the windows default sound card unchanged (i.e., windows use another sound card). By the use of DirectSound, I can enumerate all sound cards in my system.
So, after I obtained the GUID of the sound cards, how can I specify a GUID for the windows media player? Also, how can i specify another GUID for the system as its default sound card?
Thanks for your kindness help!!!
-- modified at 5:09 Tuesday 30th August, 2005
|
|
|
|
|
Trying to get a VB app to run Windows Media Services on a remote machine.
This code
tServerType = Type.GetTypeFromProgID("WMSServer.Server", <myserver>, True)
generates this error
System.Runtime.InteropServices.COMException (0x800401F3): Invalid class string
at System.RuntimeType.GetTypeFromProgIDImpl(String progID, String server, Boolean throwOnError)
at System.Type.GetTypeFromProgID(String progID, String server, Boolean throwOnError)
I really need help with how to configure my local and my remote machine to talk to each other.
HELP!!
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
"WMSServer.Server" is an invalid ProgID. Have you registered the component/proxy locally? (I have no idea how Windows Media Services work, but you mention "remote machine", so I assume you're using DCOM. Then you need to either have the components or the proxy registered on your client machine)
Good music: In my rosary[^]
|
|
|
|
|
I'm pretty green with this stuff.
I am using DCOM, yes.
I am developing on the client machine right now, so I would expect that, yes, they are registered.
"WMSServer.Server" is an invalid ProgID. Should it be the GUID?
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
DaveC426913 wrote:
"WMSServer.Server" is an invalid ProgID. Should it be the GUID?
Nah. ProgIDs and CLSIDs (Class ID which is a GUID), are mostly interchangeable. GUIDs are unique, but ProgIDs aren't [edit]necessarily, but are most of the time. (I have yet to encounter two identical ProgIDs for different components!)[/edit]
What the error says is that the component isn't registered on your computer. Not as implementation nor as proxy. You need to investigate further on that.
-- modified at 1:53 Tuesday 30th August, 2005
|
|
|
|
|
"What the error says is that the component isn't registered on your computer. Not as implementation nor as proxy. You need to investigate further on that."
Would that be on the server wherer the service is, or on the client where the app is running?
It's got to be registered somehow - it is already in use when I started developing on these boxes.
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
Hi,
I want to know whether there is any API to show Bitmaps of Registered ActiveX Controls in a ToolBox. If not , any idea on how to go about...
|
|
|
|
|
Last time I checked, I could not find one. I used the registry to extract that information.
Good music: In my rosary[^]
|
|
|
|
|
can you just code it in brief on how to show bitmaps from registry.
This is useful to me since i have no idea on how to do it.
|
|
|
|
|
The components registry "folder" is located in HKEY_CLASSES_ROOT\CLSID\{<clsid here>}.
Under that key is the ToolboxBitmap32 key. The default value of that key is the toolbox bitmap. The string value is on the form module,id. Parse the module and id into their own variables.
Then open the module using LoadLibraryEx(), using the LOAD_LIBRARY_AS_DATAFILE option. Then use the function LoadBitmap with the handle returned from LoadLibraryEx(), and the id "transformed" with MAKEINTRESOURCE().
Pseudo-code:
LPCTSTR lpszToolboxBitmap32 = GetToolboxBitmap32ForCLSID(clsidOfComponent);
LPCTSTR lpszModule;
int nId;
ParseBitmapString(lpszToolboxBitmap32, &lpszModule, &nId);
HMODULE hLibrary = ::LoadLibraryEx(lpszModule, NULL, LOAD_LIBRARY_AS_DATAFILE);
HBITMAP hBmp = ::LoadBitmap(hLibrary, MAKEINTRESOURCE(nId));
::FreeLibrary(hLibrary);
I hope this helps.
Good music: In my rosary[^]
|
|
|
|
|
Thanks for the Solution,
One problem how can i pass handle of bitmap to object of CBitmap.... or is there any other way of using it....
HBITMAP hBmp;
hBmp = ::LoadBitmap( hLibrary, MAKEINTRESOURCE(nID) );
//! Here LoadBitmap Accepts HICON & CBitmap*...but not HBITMAP..So how can I pass HBITMAP to CImageList so that it can be attached to CToolBar
CBitmap obBitmap;
obBitmap.LoadBitmap( hBmp ); //error...how to pass hBmp
CImageList obImageList;
obImageList.Create(18,18,ILC_COLOR8,2,1);
obImageList.Add( &obBitmap , RGB(0,0,0));
CToolBar obToolBar;
obToolBar.GetToolBarCtrl().SetImageList(&obImageList);
-- modified at 7:43 Thursday 1st September, 2005
|
|
|
|
|
CBitmap is just a C++ wrapper for HBITMAP. Use CBitmap::FromHandle() to acquire a CBitmap object. It returns a CBitmap*, but you don't have to free it. The returned pointer is a pointer to a temporary object, which is removed next time the window pump is idling. So in short, use the pointer on the same call stack as you acquired it. Please see the MSDN docs for a more comprehensive explanation.
Good music: In my rosary[^]
|
|
|
|
|
Thanks for the reply .... it worked out..
Now the major task for me after showing bitmaps of controls on toolbox is enabling drag 'n' drop facility of controls onto the container. I think IDesignerToolBoxSite interface is used for this. But how to use this interface in my application is what is troubling me?
Can u help me in this regard?
|
|
|
|
|
hi
I am having problem in callling remote components methods..I tried for the same but was tnot sucessful
Any kind of help is appreciated
cheers
|
|
|
|
|
What problem are you facing?
What type of component is it? (Dll or Exe)
Did you build the proxy and registered the same?
|
|
|
|
|
Hi all,
I have just written a VC7 program which uses ATL & COM. It is giving the following linker errors :
nafxcwd.lib(thrdcore.obj) : error LNK2019: unresolved external symbol __endthreadex referenced in function "void __stdcall AfxEndThread(unsigned int,int)" (?AfxEndThread@@YGXIH@Z)
and
nafxcwd.lib(thrdcore.obj) : error LNK2019: unresolved external symbol __beginthreadex referenced in function "public: int __thiscall CWinThread::CreateThread(unsigned long,unsigned int,struct _SECURITY_ATTRIBUTES *)" (?CreateThread@CWinThread@@QAEHKIPAU_SECURITY_ATTRIBUTES@@@Z)
Can anyone tell why are errors ocurring and how to resolve them?
Thanking You.
Regards,
Harshad
|
|
|
|
|
guys
i have been asked to convert a simple dll that is called from vb into an activex that can be used directly in vb... the dll has only 2 functions and no gui of any kind... it doesnt use mfc or atl
what would be the best way to go about doing this for someone who hasnt done any com programming in a _very_ long time?
thnx
"there is no spoon" biz stuff about me
|
|
|
|
|
I would create a new DLL project, based on the ATL/DLL wizard template. Then I'm assuming that you want to encapsulate the original two functions, into a COM class, which you can instantiate and use from within VB. Simply create a new class in VS.NET by right clicking the project in the solutions view, and chose Add -> Add Class, and then pick ATL Simple Object.
In the ATL Simple Object Wizard, enter a name for the class, and hit OK. The default options will do just fine, unless you're doing something fancy with your apartments. You might want to turn on IErrorInfo-support if you want to provide error messages when you return error codes from your COM methods.
Anyway, when you're done, add your two functions to the interface that was created alongside your class. You'll find it in the class view. As you add interface members through the GUI in the class view, all related files will be updated (including .idl, .h and .cpp files). Then you just fill in the blanks (which is presumably the content of your two functions).
Good music: In my rosary[^]
|
|
|
|
|
thnx jorgen
is there anything different to do if i dont have vs.net? i have vc6
|
|
|
|
|
No difference. Well, obviously the IDE menus and wizards will be different, but the concept's still the same. I'm not sure if the IDE will update all related files, if you add an interface method using a wizard though.
By the way, make sure you label your parameters with [in], [out], [out, retval], etc, where appropriately. I know VBScript will barf if you miss such a parameter attribute, and I suspect VB will too.
Good music: In my rosary[^]
|
|
|
|
|
|
ok... i hate doing this 2u but i get:
Linking...
Creating library Debug/ax2.lib and object Debug/ax2.exp
uuid.lib(cguid_i.obj) : fatal error LNK1103: debugging information corrupt; recompile module
Error executing link.exe.
every time i try to compile the damn thing
any clue what this could mean?
"there is no spoon" biz stuff about me
|
|
|
|