Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / June 2004

Tip: Looking for answers? Try searching our database.

Bi-directional communication between IE(aspx) and embedded Win Ctrl

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RBisch - 03 Jun 2004 17:16 GMT
Hi all,
I have a web application (asp.net) that is communicating with an embedded windows control (local ctrl) hosted by Internet Explorer.  I have been passing data and raising events fine via Interface programming (IDispatch).  However, the only data I've been passing has been strings, bool, and ints.  I need to pass a stream (e.g. byte[] ) from my code-behind (aspx.cs) to my emb. local ctrl.  

Would I do this via Javascript/JScript, and if so how ?  [I can not use webservices either]
(note:that is how I am currently communicating from my webpage to the emb. local ctrl.)

References:
http://msdn.microsoft.com/msdnmag/issues/02/01/UserCtrl/default.aspx
http://support.microsoft.com/?kbid=313891

Thanks in advance.
"Ying-Shen Yu[MSFT]" - 04 Jun 2004 04:22 GMT
Hi,

have you tried defining the method in your event source interface like
below:

[DispIdAttribute(0x60020001)]
void MyByteEvent( ref byte[] bytes);

It works fine in VB6, please feel free to reply this thread if it does not
work in script languages.
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
RBisch - 10 Jun 2004 19:36 GMT
Dear Ying-Shen Yu,
I believe this would work in the case of communication from the embedded IE .NET control to IE itself.

Therefore your code sample:
//PrintCtrl embedded IE object
[DispIdAttribute(0x60020001)]
void MyByteEvent( ref byte[] bytes);

would allow me to do something like this in Javascript (IE):
//PrintCtrl is the id on the <OBJECT> tag
        function PrintCtrl::MyByteEvent( ref byte[] bytes)
           {   //setting value to html element via javascript DOM            
               document.all.myForm.bytes.value = bytes;
           }

That is fine, but I need to pass a byte[][] from code-behind (aspx.cs) to the embedded I.E. control, which would be the reverse (opposite) of the above sample.

Do you know how this can be accomplished ?

Thanks in advance.

> Hi,
>
[quoted text clipped - 17 lines]
> This mail should not be replied directly, please remove the word "online"
> before sending mail.
"Ying-Shen Yu[MSFT]" - 11 Jun 2004 07:04 GMT
Hi,

If you need pass a byte(,) array to .NET you may define a public method on
your embedded control and use the definition like:

void FireMyByteEvent( ref byte[ , ] bytes);

bytes will be marshaled as In and Out, so change the data in the bytes
array will modify the array in script as well.

Is this what your need?
Feel free to let me know if you have any problem when using it.

Have a nice day!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.