HTML Tutorial


 /help/HTML Help Forum   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
USING .DLL FILE IN HTML AND JAVASCRIPT
Post new topic   Reply to topic    HTML Help Forum -> Others
View previous topic :: View next topic  
Author Message
Gennady46



Joined: 07 Nov 2009
Posts: 2

PostPosted: Tue Nov 10, 2009 5:41 pm     USING .DLL FILE IN HTML AND JAVASCRIPT Reply with quote

Hi, I wrote the following class in C++ just to test:

#pragma once
#include <windows.h>
#include <stdio.h>
namespace Test1 {

public ref class Class1
{ public: void Web_Code()
{ DeleteFile("c:\\Test_Web.txt");
printf("Hello");
}
};
}
And built it. So I got Web_Test.dll
I uploaded to my web folder Web_Test.dll
And inserted html onto the web page:

<OBJECT id="control"
classid="http:Web_Test.dll#Test1.Class1">
</OBJECT>
<script language="javascript">
function doScript()
{
control.Web_Code();
}
</script>
<body onLoad="javascript:doScript();">

What it suppose to do is to delete a file on a hard drive and print "Hello" on a screen as a web page is
being opened.

But it does not work!
Can you tell me what is wrong here.
Thanks in advance, G.G.
PayneLess Designs



Joined: 28 Feb 2007
Posts: 4289
Location: MS

PostPosted: Wed Nov 25, 2009 11:49 pm     Reply with quote

Maybe path is incorrect, "c:\\Test_Web.txt". Try:

file:///c://Test_Web.txt

Plus, most *.dll's are called by an executable.

Deleting files from a hard drive using a web page rangs a lot of bells here. Viruses do that and you are probably going to have problems with anti-virus programs, firewalls and many security setting from user's computer which do not allow running executables like that.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum -> Others All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial