Identifing file type or OLE component migration to .net

G

Guest

We had an old application developed using Visual Basic Language.
We are trying to replace that application with .net 2005, C# Language.

In the old application, we had a file attachment component. Purpose of this
component was to attach a file to a ticket and store the file in the
database (Sybase).

I don't have access to the old application but have the following
information about
how this component worked:

1. This component was using a OLE Container control.
2. When a file was selected for attachement, The file content was
inserted into the OLE control.
3. The Binary output of getdata()(????) function was inserted into the
database.
4. Later, when a file was selected to view, the binary data was retrieved and
inserted into the OLE Container. Then activate() method was used to launch
the application associated to the attached file.


Problem we have is that when the file was saved to the database, Application
did not store the file name. So what we have is only the binary data in the
database.
We have no way of knowing what type of file it is (whether MSWord, MSExcel,
Zip file etc).
In the old application, it was the OLE control, which was identifying the
associated application
and opening the file using the application.

As in .net, we do not have any corresponding OLE Control, which can do the
similar functionality.

What I like to know from you is

1. Is there any way or API, which can help me identify from the binary data,
what kind of
file it is (like word, excel, zip, text etc..)
2. Is there a way to achieve OLE Control like functionality in .net.
 
N

Nicholas Paldino [.NET/C# MVP]

talam,

Why don't you just import the OLE control into .NET? You can create an
ActiveX wrapper which will allow you to use it.

Hope this helps.
 
G

Guest

Thank you for your response. This Ole Control is one of the form control
provided as part of Vantive (Peoplesoft) CRM studio, used for form
customization etc.
I don't have access to their source code or the individual controls. We have
used the development studio to customized the forms using the control
provided. Any customized code are written in VBA.
I hope this explain the situation. Not sure whether we can use your
suggested approach.

Nicholas Paldino said:
talam,

Why don't you just import the OLE control into .NET? You can create an
ActiveX wrapper which will allow you to use it.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

talam said:
We had an old application developed using Visual Basic Language.
We are trying to replace that application with .net 2005, C# Language.

In the old application, we had a file attachment component. Purpose of
this
component was to attach a file to a ticket and store the file in the
database (Sybase).

I don't have access to the old application but have the following
information about
how this component worked:

1. This component was using a OLE Container control.
2. When a file was selected for attachement, The file content was
inserted into the OLE control.
3. The Binary output of getdata()(????) function was inserted into the
database.
4. Later, when a file was selected to view, the binary data was retrieved
and
inserted into the OLE Container. Then activate() method was used to
launch
the application associated to the attached file.


Problem we have is that when the file was saved to the database,
Application
did not store the file name. So what we have is only the binary data in
the
database.
We have no way of knowing what type of file it is (whether MSWord,
MSExcel,
Zip file etc).
In the old application, it was the OLE control, which was identifying the
associated application
and opening the file using the application.

As in .net, we do not have any corresponding OLE Control, which can do the
similar functionality.

What I like to know from you is

1. Is there any way or API, which can help me identify from the binary
data,
what kind of
file it is (like word, excel, zip, text etc..)
2. Is there a way to achieve OLE Control like functionality in .net.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top