tags:

views:

263

answers:

1

I have an ActiveX object that I made with C# and registered in the system. I'm loading it with JavaScript in HTML like this:

<object id="myComComponent" name="myComComponent" classid="clsid:MY_ACTIVEX_GUID"></object>

This works fine. Now I want to open a file that exist in the same directory as the html inside the ActiveX object. The trouble is that I need the full path of the file and when I try

String curDir = Directory.GetCurrentDirectory();

I get the path to my desktop, which is not where the file are. When I hardcode the file and path in the ActiveX object it works fine. What I want though is to be able to just give the file name (without path of course) as a parameter inside the OBJECT tag.

A: 
<object id="myComComponent" name="myComComponent" classid="clsid:MY_ACTIVEX_GUID">
    <param name="FileName" value="test.pdf" />
</object>

Which would be bound to a FileName property on your ActiveX class.

Darin Dimitrov
Yes, I know how to do that. The problem is how do I get the full path of the file.
Decept