Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > ActiveX or COM or ...?

Reply
Thread Tools

ActiveX or COM or ...?

 
 
Randy Dietz
Guest
Posts: n/a
 
      01-16-2004
Hi, how can I create a simple non-UI dll or component which will be used by
MS Access and .ASP apps which I can build with Visual C++ .net? An example
or template which would allow me to paste in C code without learning all the
C++ details would be perfect.

Thanks,
Randy


 
Reply With Quote
 
 
 
 
Mark Schupp
Guest
Posts: n/a
 
      01-17-2004
MSVC++ has wizards to create server-side com objects. I would expect that
C++ .net would as well. There should also be some sample code available as
well.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com


"Randy Dietz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi, how can I create a simple non-UI dll or component which will be used

by
> MS Access and .ASP apps which I can build with Visual C++ .net? An

example
> or template which would allow me to paste in C code without learning all

the
> C++ details would be perfect.
>
> Thanks,
> Randy
>
>



 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      01-17-2004
Why dont you try to use VB5/6/VB.NET for example if C++ like syntax is not
the one that you like?

"Randy Dietz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
: Hi, how can I create a simple non-UI dll or component which will be used
by
: MS Access and .ASP apps which I can build with Visual C++ .net? An
example
: or template which would allow me to paste in C code without learning all
the
: C++ details would be perfect.
:
: Thanks,
: Randy
:
:


 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      01-17-2004
Hi Randy,

Thank you for posting here. Regarding on the issue, I am
finding proper resource to assist you and we will update as soon as posible.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security(This posting is provided "AS IS",
with no warranties, and confers no rights.)

 
Reply With Quote
 
Randy Dietz
Guest
Posts: n/a
 
      01-17-2004
People in other newsgroups suggested posting here. A few people recommend
using a COM Server or ATL Server but I tried that using
file|new|project|visual c++ projects|ATL|ATL project and couldn't get VBA
code to recognize MyFunc99 maybe because my VBA Declare statement is
incorrect.

In VBA I used

Private Declare Sub MyFunc99 Lib "C:\Documents and Settings\default\My
Documents\Msaccess\Test4" (s1 As String)
....
Dim s1 As String
MyFunc99 (s1)

A summary of info and notes from myself and other posters...
1. create a simple non-UI dll or component which will be used by MS Access
and .ASP apps.
2. use COM because .ASP can't use a DLL.
3. the component needs to work on both non-.net and .net systems if
possible.


"Steven Cheng[MSFT]" <(E-Mail Removed)> wrote in message
news:fD9A%(E-Mail Removed)...
> Hi Randy,
>
> Thank you for posting here. Regarding on the issue, I am
> finding proper resource to assist you and we will update as soon as

posible.
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security(This posting is provided "AS IS",
> with no warranties, and confers no rights.)
>



 
Reply With Quote
 
Randy Dietz
Guest
Posts: n/a
 
      01-18-2004
Class view shows that rsdm2() is exported I think...

Test4
...
Irsd2
...
rsdm2(BSTR *s1)

and the build log shows that regsvr32 test4.dll registers the dll so how do
I get MS Access to use the dll? Tools|ActiveX Controls lists many controls
but no rsd* nor test4* symbols.

Build Log ------- Build started: Project: test4, Configuration:
Debug|Win32 -------

Command Lines Creating temporary file "c:\Documents and
Settings\default\My Documents\Visual Studio
Projects\test4\Debug\RSP000013.rsp" with contents
[
/Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_USRDLL" /D "_ATL_ATTRIBUTES"
/D "_WINDLL" /D "_ATL_STATIC_REGISTRY" /D "_MBCS" /Gm /EHsc /RTC1 /MDd
/Yu"stdafx.h" /Fp"Debug/test4.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c
/Wp64 /ZI /TP
".\toupper.cpp"
".\test4.cpp"
".\rsd2.cpp"
".\rsd1.cpp"
]
Creating command line "cl.exe @"c:\Documents and Settings\default\My
Documents\Visual Studio Projects\test4\Debug\RSP000013.rsp" /nologo"
Creating temporary file "c:\Documents and Settings\default\My
Documents\Visual Studio Projects\test4\Debug\RSP000014.rsp" with contents
[
/Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_USRDLL" /D "_ATL_ATTRIBUTES"
/D "_WINDLL" /D "_ATL_STATIC_REGISTRY" /D "_MBCS" /Gm /EHsc /RTC1 /MDd
/Yc"stdafx.h" /Fp"Debug/test4.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c
/Wp64 /ZI /TP
".\stdafx.cpp"
]
Creating command line "cl.exe @"c:\Documents and Settings\default\My
Documents\Visual Studio Projects\test4\Debug\RSP000014.rsp" /nologo"
Creating command line "rc.exe /d "_DEBUG" /l 0x409 /I "Debug"
/fo"Debug/test4.res" ".\test4.rc""
Creating temporary file "c:\Documents and Settings\default\My
Documents\Visual Studio Projects\test4\Debug\RSP000015.rsp" with contents
[
/OUT:"Debug/test4.dll" /INCREMENTAL /NOLOGO /DLL /IDLOUT:"_test4.idl" /DEBUG
/PDB:"Debug/test4.pdb" /SUBSYSTEM:WINDOWS /IMPLIB:"Debug/test4.lib"
/MACHINE:X86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib
".\Debug\rsd1.obj"
".\Debug\rsd2.obj"
".\Debug\stdafx.obj"
".\Debug\test4.obj"
".\Debug\toupper.obj"
".\Debug\test4.res"
]
Creating command line "link.exe @"c:\Documents and Settings\default\My
Documents\Visual Studio Projects\test4\Debug\RSP000015.rsp""
Creating temporary file "c:\Documents and Settings\default\My
Documents\Visual Studio Projects\test4\Debug\BAT000016.bat" with contents
[
@echo off
cd .\Debug
regsvr32 /s "test4.dll"
]
Creating command line ""c:\Documents and Settings\default\My
Documents\Visual Studio Projects\test4\Debug\BAT000016.bat""
Creating temporary file "c:\Documents and Settings\default\My
Documents\Visual Studio Projects\test4\Debug\BAT000017.bat" with contents
[
@echo off
regsvr32 /s /c "c:\Documents and Settings\default\My Documents\Visual Studio
Projects\test4\Debug\test4.dll"
if errorlevel 1 goto VCReportError
goto VCEnd
:VCReportError
echo Project : error PRJ0019: A tool returned an error code from "Performing
registration"
exit 1
:VCEnd
]
Creating command line ""c:\Documents and Settings\default\My
Documents\Visual Studio Projects\test4\Debug\BAT000017.bat""
Output Window Compiling...
stdafx.cpp
Compiling...
toupper.cpp
test4.cpp
rsd2.cpp
rsd1.cpp
Generating Code...
Compiling resources...
Linking...
Creating library Debug/test4.lib and object Debug/test4.exp
Microsoft (R) 32b/64b MIDL Compiler Version 6.00.0361
Copyright (c) Microsoft Corporation 1991-2002. All rights reserved.
Processing .\_test4.idl
_test4.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\prsht.idl
prsht.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\wtypes.idl
wtypes.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\basetsd.h
basetsd.h
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\guiddef.h
guiddef.h
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\mshtml.idl
mshtml.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\ocidl.idl
ocidl.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\oleidl.idl
oleidl.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\objidl.idl
objidl.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\unknwn.idl
unknwn.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\oaidl.idl
oaidl.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\servprov.idl
servprov.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\urlmon.idl
urlmon.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\msxml.idl
msxml.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\dimm.idl
dimm.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\mshtmhst.idl
mshtmhst.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\docobj.idl
docobj.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\exdisp.idl
exdisp.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\objsafe.idl
objsafe.idl
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\oaidl.acf
oaidl.acf
Processing C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\include\ocidl.acf
ocidl.acf
Registering output...
Performing registration
Results Build log was saved at "file://c:\Documents and
Settings\default\My Documents\Visual Studio
Projects\test4\Debug\BuildLog.htm"
test4 - 0 error(s), 0 warning(s)

"Randy Dietz" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> People in other newsgroups suggested posting here. A few people recommend
> using a COM Server or ATL Server but I tried that using
> file|new|project|visual c++ projects|ATL|ATL project and couldn't get VBA
> code to recognize MyFunc99 maybe because my VBA Declare statement is
> incorrect.
>
> In VBA I used
>
> Private Declare Sub MyFunc99 Lib "C:\Documents and Settings\default\My
> Documents\Msaccess\Test4" (s1 As String)
> ...
> Dim s1 As String
> MyFunc99 (s1)
>
> A summary of info and notes from myself and other posters...
> 1. create a simple non-UI dll or component which will be used by MS Access
> and .ASP apps.
> 2. use COM because .ASP can't use a DLL.
> 3. the component needs to work on both non-.net and .net systems if
> possible.
>
>
> "Steven Cheng[MSFT]" <(E-Mail Removed)> wrote in message
> news:fD9A%(E-Mail Removed)...
> > Hi Randy,
> >
> > Thank you for posting here. Regarding on the issue, I am
> > finding proper resource to assist you and we will update as soon as

> posible.
> >
> > Regards,
> >
> > Steven Cheng
> > Microsoft Online Support
> >
> > Get Secure! www.microsoft.com/security(This posting is provided "AS IS",
> > with no warranties, and confers no rights.)
> >

>
>



 
Reply With Quote
 
MSFT
Guest
Posts: n/a
 
      01-19-2004
Hi Randy,

hank you for using MSDN Newsgroup. I am Luke and I am review this issue
currently. As I understand, you want to create a component with VC++.NET
which can be used both in .NET application and Access application. Based on
the requirement, I think Class Library (.NET) should be a proper solution.
(File/New?Project/VC++ Project/Class Library (.NET) ). You can add your
functions in the source file and compile it to a DLL files.

To use the DLL file in another dot application, you can select "Project/Add
a reference", select the DLL file and add the reference file.

To use it in Access application, you first need register it as a COM
librrary with a utility "Regasm.exe":

http://msdn.microsoft.com/library/de...us/cptools/htm
l/cpgrfassemblyregistrationtoolregasmexe.asp

In Access, you can click menu "Tool/Reference" and find the type library in
the list.

Hope this help,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
Mark Schupp
Guest
Posts: n/a
 
      01-19-2004
You do not use declare statements with com object.

After the com object is compiled and registered you use CreateObject just as
you would for a built-in asp object.

set myobj= createobject("mydll.myobject")

Dim s1

s1 = ""

myobj.myfunc( s1 )

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com


"Randy Dietz" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> People in other newsgroups suggested posting here. A few people recommend
> using a COM Server or ATL Server but I tried that using
> file|new|project|visual c++ projects|ATL|ATL project and couldn't get VBA
> code to recognize MyFunc99 maybe because my VBA Declare statement is
> incorrect.
>
> In VBA I used
>
> Private Declare Sub MyFunc99 Lib "C:\Documents and Settings\default\My
> Documents\Msaccess\Test4" (s1 As String)
> ...
> Dim s1 As String
> MyFunc99 (s1)
>
> A summary of info and notes from myself and other posters...
> 1. create a simple non-UI dll or component which will be used by MS Access
> and .ASP apps.
> 2. use COM because .ASP can't use a DLL.
> 3. the component needs to work on both non-.net and .net systems if
> possible.
>
>
> "Steven Cheng[MSFT]" <(E-Mail Removed)> wrote in message
> news:fD9A%(E-Mail Removed)...
> > Hi Randy,
> >
> > Thank you for posting here. Regarding on the issue, I am
> > finding proper resource to assist you and we will update as soon as

> posible.
> >
> > Regards,
> >
> > Steven Cheng
> > Microsoft Online Support
> >
> > Get Secure! www.microsoft.com/security(This posting is provided "AS IS",
> > with no warranties, and confers no rights.)
> >

>
>



 
Reply With Quote
 
Randy Dietz
Guest
Posts: n/a
 
      01-19-2004
Luke, several others suggested that a COM object will work with both
MSAccess and .ASP. I used oleview.exe 'object classes->all objects' and
there are no rsd* objects so it appears that regsvr32 fails when the vc++
build calls it even though there are no err messages. I copied and built

LABRADOR Sample: Implements a Server with an Out-of-Proc Custom Interface
and Compiler COM Support

then tried oleview and LABRADOR is listed under 'object classes->all objects
' so I must be missing something in my project.


I started over and did...

create test9 with file|new|project|visual c++ projects|ATL|ATL project
right-click test9 in solution explorer
add the rsdm1 class using add|add class|visual c++|ATL|ATL Simple Object
rebuild all and the build log has

regsvr32 /s /c "c:\documents and settings\default\my documents\visual studio
projects\test9\debug\test9.dll"

run oleview.exe 'object classes->all objects' and there are no rsd* objects
listed.

Do I need to do something more to make rsdm1 a COM object or am I missing
something else?


"MSFT" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Randy,
>
> hank you for using MSDN Newsgroup. I am Luke and I am review this issue
> currently. As I understand, you want to create a component with VC++.NET
> which can be used both in .NET application and Access application. Based

on
> the requirement, I think Class Library (.NET) should be a proper solution.
> (File/New?Project/VC++ Project/Class Library (.NET) ). You can add your
> functions in the source file and compile it to a DLL files.
>
> To use the DLL file in another dot application, you can select

"Project/Add
> a reference", select the DLL file and add the reference file.
>
> To use it in Access application, you first need register it as a COM
> librrary with a utility "Regasm.exe":
>
>

http://msdn.microsoft.com/library/de...us/cptools/htm
> l/cpgrfassemblyregistrationtoolregasmexe.asp
>
> In Access, you can click menu "Tool/Reference" and find the type library

in
> the list.
>
> Hope this help,
>
> Luke
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>



 
Reply With Quote
 
Randy Dietz
Guest
Posts: n/a
 
      01-20-2004
When I run

regsvr32 /c "c:\documents and settings\default\my documents\visual studio
projects\test9\debug\test9.dll"

I get a messagebox that says

DllRegister in c:\documents and settings\default\my documents\visual studio
projects\test9\debug\test9.dll succeeded.

but oleview doesn't list any rsd* objects.


"MSFT" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Randy,
>
> hank you for using MSDN Newsgroup. I am Luke and I am review this issue
> currently. As I understand, you want to create a component with VC++.NET
> which can be used both in .NET application and Access application. Based

on
> the requirement, I think Class Library (.NET) should be a proper solution.
> (File/New?Project/VC++ Project/Class Library (.NET) ). You can add your
> functions in the source file and compile it to a DLL files.
>
> To use the DLL file in another dot application, you can select

"Project/Add
> a reference", select the DLL file and add the reference file.
>
> To use it in Access application, you first need register it as a COM
> librrary with a utility "Regasm.exe":
>
>

http://msdn.microsoft.com/library/de...us/cptools/htm
> l/cpgrfassemblyregistrationtoolregasmexe.asp
>
> In Access, you can click menu "Tool/Reference" and find the type library

in
> the list.
>
> Hope this help,
>
> Luke
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveX control in python vs ActiveX control in vb 6 (piece of code) vml Python 0 08-22-2007 09:57 AM
ActiveX apologetic Larry Seltzer... "Sun paid for malicious ActiveX code, and Firefox is bad, bad bad baad. please use ActiveX, it's secure and nice!" (ok, the last part is irony on my part) fernando.cassia@gmail.com Java 0 04-16-2005 10:05 PM
Type mismatch using Mozilla ActiveX in place of Microsoft WebBrowser? Noozer Firefox 0 05-19-2004 08:08 AM
Problems with ActiveX usage in C# usercontrol BestNews ASP .Net 0 08-20-2003 09:14 AM
My ATL com activex control not working in C# & VB .net Sunil George ASP .Net 1 08-06-2003 08:34 AM



Advertisments