471,570 Members | 1,039 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,570 software developers and data experts.

Identifing file type or OLE component migration to .net

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.
Jan 9 '06 #1
2 1752
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]
- mv*@spam.guard.caspershouse.com

"talam" <ta***@discussions.microsoft.com> wrote in message
news:94**********************************@microsof t.com...
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.

Jan 11 '06 #2
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 [.NET/C# MVP]" wrote:
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]
- mv*@spam.guard.caspershouse.com

"talam" <ta***@discussions.microsoft.com> wrote in message
news:94**********************************@microsof t.com...
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.


Jan 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by tshad | last post: by
1 post views Thread by Jerry John | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.