Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Help with first DLL
Ok I started this post in another thread but the topic I think should be
placed here based on my current status.

I have built a DLL that returns this error when accessed from an ASP page:
DDE Error:369 :Operation not valid in an ActiveX DLL

Here is the code:
Public Function DDEInitiate() As String

On Error GoTo Err_DDE

With lblGMDDE
.LinkMode = vbLinkNone
.LinkTopic = "GoldMine|Data"
.LinkMode = vbLinkManual

.LinkItem = "&UserName"
.LinkRequest
DDEInitiate = .Caption
End With

Exit Function

Err_DDE:
If Err = 282 Then
DDEInitiate = 282
Else
'Err.Description = "DDE Error:" & Err & " :" & Err.Description
DDEInitiate = "DDE Error:" & Err & " :" & Err.Description
End If

End Function

Nothing really fancy and I run it from a Class called GM with this Functions
:
Public Function GetUserID() As String
GetUserID = frmDDE.DDEInitiate
End Function

Again, nothing really fancy but yet I still get stumped.


Report this thread to moderator Post Follow-up to this message
Old Post
Webbee
09-30-04 08:55 PM


RE: Help with first DLL
Ok I changed the DLL to an EXE and that helps. If I reference this from
another VB program it works great! But if I reference this from an ASP page 
I
get a 282 error. Here is the ASP page code that I'm using.

<% Option Explicit

Dim oGMUser 'Create an object for the component
Dim Username 'Create a string to hold the result

'Create an instance of the Component we just wrote
Set oGMUser = CreateObject("GMCurrentUser.GM_Class")

'Call the IsLeapYear function in our component, and
'store the result
UserName = oGMUser.GetUserID

'Close the instance, good programming practice
Set oGMUser = Nothing

%>
<HTML>
<HEAD>
<TITLE>Gm User</TITLE>
</HEAD>
<BODY>
<%
'Let the user know
Response.Write UserName
%>
</BODY>
</HTML>


"Webbee" wrote:

> Ok I started this post in another thread but the topic I think should be
> placed here based on my current status.
>
> I have built a DLL that returns this error when accessed from an ASP page:
> DDE Error:369 :Operation not valid in an ActiveX DLL
>
> Here is the code:
> Public Function DDEInitiate() As String
>
> On Error GoTo Err_DDE
>
>     With lblGMDDE
>         .LinkMode = vbLinkNone
>         .LinkTopic = "GoldMine|Data"
>         .LinkMode = vbLinkManual
>
>         .LinkItem = "&UserName"
>         .LinkRequest
>         DDEInitiate = .Caption
>     End With
>
>     Exit Function
>
> Err_DDE:
>     If Err = 282 Then
>         DDEInitiate = 282
>     Else
>         'Err.Description = "DDE Error:" & Err & " :" & Err.Description
>         DDEInitiate = "DDE Error:" & Err & " :" & Err.Description
>     End If
>
> End Function
>
> Nothing really fancy and I run it from a Class called GM with this Functio
ns:
> Public Function GetUserID() As String
>     GetUserID = frmDDE.DDEInitiate
> End Function
>
> Again, nothing really fancy but yet I still get stumped.
>

Report this thread to moderator Post Follow-up to this message
Old Post
Webbee
09-30-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Visual Basic archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:44 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.