473,770 Members | 6,978 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using C# dll methods in asp

AnuSumesh
96 New Member
Hi All,

I have one dll written in c#. One of its methods return array of dictionary.
I want to call and use that method in ASP file.
I am using jscript in ASP.

my code is a s follows:
Expand|Select|Wrap|Line Numbers
  1. <%
  2. var cls;
  3. cls=new ActiveXObject("shareaccessanu.FileOperations");
  4. var collection=cls.getdic();
  5. Response.write("type of  collection "+typeof(collection));
  6. %>
  7.  
the output is "unknown" i.i typeof returns unknown

How can i use this?

The dll name is shareaccessanu and it contains 3 different classes named Fileoperations, Share. Sharecollection .
One of method of class Fileoperations returns array of class Share.
How to use all these methods in Jscript.

Plzzzz help me in above issues.
I ll be fired if i will not complete the project.
Its very urgent.

Thanks,
Anu
Nov 19 '08 #1
9 7012
jhardman
3,406 Recognized Expert Specialist
I know this isn't what you wanted to hear, but my suggestion is abandon asp, do this whole thing in .NET - then referencing an outside .dll is built-in.

Jared
Nov 20 '08 #2
AnuSumesh
96 New Member
I can't avoid ASP.
My company already have some project which is using dll.
I have to replca ethat dll with my dll which should support all exisitng dll functions.
Even i dont know the functionality of some of existing dll functions

Plzzzzz help

Anu
Nov 21 '08 #3
AnuSumesh
96 New Member
Hi All,

I have created one dll in c# and using that dll in ASP programs. All dll methods are working fine ion ASP except one method that returns dictionary object.
When i am calling that method in asp (using jscript), its giving error "object unknown".

My asp code is as follows:

Expand|Select|Wrap|Line Numbers
  1. var cls=new ActiveXObject("shareaccessanu.FileOperations"); 
  2. //shareaccessanu is dll name
  3. var item=cls.UsrBrowseContent("D:\\Anu"); //method returns dictionary object
  4. Response.write("typeof= "+typeof(item)); //return "unknown"
  5.  
Can anyone please help me how can I use this method in ASP?
Plzzzzzzzz its urgent.

Thanks,
ANU
Dec 2 '08 #4
jhardman
3,406 Recognized Expert Specialist
Anu,

1- Please don't double-post your questions. I have merged threads this time, but consider this a warning. Double posting is strictly prohibited by the Bytes site guidelines. Asking an expert to weigh in on a particular question that has gone unanswered is permitted.

2- Please write your words out. When I see "plzzzzz" in a post my first response is "this poster is so lazy he can't even be bothered to write out 'please'. Why should I help someone that lazy?" This is a common gripe among forum mods and experts, we will all be similarly annoyed by your posts.

3- I don't think any of us do what you are trying to do, the number of people who write asp is small enough, the number who write asp in javascript is a small fraction of that, and the number who include custom dlls in a classic asp page is staggeringly low. Nevertheless, from your last post, I see that the error given says the object is unrecognized. Which line is giving this error? The new object line or the UsrBrowseConten t line?

Jared
Dec 3 '08 #5
CroCrew
564 Recognized Expert Contributor
Hello AnuSumesh,

Let’s see if we can figure this one out. Please post the code you’re using to call this method too. That might help out with finding a solution.

CroCrew~
Dec 4 '08 #6
AnuSumesh
96 New Member
Hi
Thanks for considering my problem.

DLL method code is as follows:

Expand|Select|Wrap|Line Numbers
  1. public Dictionary<string, string> AdmEnumerateDomains()
  2.         {
  3.             Dictionary<string, string> dic = new Dictionary<string, string>();
  4.             dic.Add("anu", "female");
  5.             return dic;
  6.         }
  7.  
ASP code(using jscript)
Expand|Select|Wrap|Line Numbers
  1. //dll is shareaccessanu and class name is FileOperations
  2. var cls;
  3. cls=new ActiveXObject("shareaccessanu.FileOperations"); 
  4.  
  5. var collection=cls.AdmEnumerateDomains();
  6. Response.write("type of "+typeof(collection)); // result is "unknown"
  7.  
Thanks
Anu
Dec 4 '08 #7
CroCrew
564 Recognized Expert Contributor
Hello AnuSumesh,

With the help of a good friend of mine (thanks Mike!) I came up with this:

I ' m not sure what you're trying to get out of the typeof() operator.... it looks like it will only return six possible values: The typeof operator returns type information as a string. There are six possible values that typeof returns: "number," "string," "boolean," "object," "function," and "undefined. "

It seems, and I've not tested this so I may be wrong, that since you've already returned the method and cast it as a var, it wouldn't really know what type of object it is....

Can you do something like this? typeof(cls.AdmE numerateDomains ())?

I would guess that doing that would return object, but I ' m not sure how helpful that is to you.

Sorry I can't be more helpful. Kind of a goofy setup (C# dll being used by Jscript via a Classic ASP page).
Dec 4 '08 #8
AnuSumesh
96 New Member
Thanks a lot.

I have tried your option also but its also giving output "UNKNOWN".

Actually i want to call this method(returns dictionaryobjec t) in asp page.

Thanks,
Anu
Dec 5 '08 #9
CroCrew
564 Recognized Expert Contributor
Hello AnuSumesh,

Sorry I can't be more helpful in solving your problem. Like I said kind of a quirky setup you got there.

Hope you find a solution top your problem,
CroCrew~
Dec 5 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2072
by: Michael Sparks | last post by:
Anyway... At Europython Guido discussed with everyone the outstanding issue with decorators and there was a clear majority in favour of having them, which was good. From where I was sitting it looked like about 20:20 split on the following syntaxes: 1 def func(arg1, arg2, arg3) : function... 2 def func(arg1, arg2, arg3): function...
5
1734
by: Andrew | last post by:
I want to use a managed c++ class from an unmanaged class. Here is my code: // *** Unmanaged Code // .h file class UnmanagedClass { public: // Other stuff here
6
17205
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically, process and output to the screen in my application when a message arrived. But the problem is how do I read the SMS message immediately when it arrived without my handphone BeEPINg for new message ? I read up the AT commands, but when getting down...
5
3849
by: chandu | last post by:
can any one give advantages and disadvantages to using static methods in a class. shall we use complete static methods in a class ? thanks
4
2132
by: a_agaga | last post by:
Hi! Do you know different alternatives to convert exceptions in many methods of some wrapper classes. User -Wrapper classes -LibraryClasses -... Wrapper classes catch an exception of only one type, let's call it e.g. "InternalException_c". There are no other types of exceptions, which should be catched /
6
3681
by: semkaa | last post by:
Can you explain why using ref keyword for passing parameters works slower that passing parameters by values itself. I wrote 2 examples to test it: //using ref static void Main(string args) { List<TimeSpantimes = new List<TimeSpan>(); DateTime start; DateTime end; for (int j = 0; j < 1000; j++)
6
1885
by: burningodzilla | last post by:
Hi all - I'm preparing to dive in to more complex application development using javascript, and among other things, I'm having a hard time wrapping my head around an issues regarding "inheritance" using the prototype property. I realize there are no classes in JS, that code therefore lives in objects instead of class definitions, and that "inheritance" must be achieved prototypically and not classically. That said, on with the code. Say I...
7
402
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I access a property of an object using a string? ----------------------------------------------------------------------- There are two ways to access properties: the dot notation and the square bracket notation. What you are looking for is the square bracket notation in which the dot, and the identifier to its right, are replaced with a set of...
61
2978
by: Sanders Kaufman | last post by:
I'm wondering if I'm doing this right, as far as using another class object as a PHP class property. class my_baseclass { var $Database; var $ErrorMessage; var $TableName; var $RecordSet; function my_baseclass(){ $this->TableName = "";
83
4236
by: liketofindoutwhy | last post by:
I am learning more and more Prototype and Script.aculo.us and got the Bungee book... and wonder if I should get some books on jQuery (jQuery in Action, and Learning jQuery) and start learning about it too? Once I saw a website comparing Prototype to Java and jQuery to Ruby... but now that I read more and more about Prototype, it is said that Prototype actually came from Ruby on Rails development and the creator of Prototype created it...
0
9591
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10228
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10057
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10002
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3575
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.