473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

dll sample or walkthrough?

Hi, I need to create a simple dll which will be used by
MS Access and .ASP apps. What type of dll would be best
and can anybody point me to a complete example which I
can compile and run with Visual C++ .net?

Thanks,
Randy

Nov 17 '05 #1
19 4236
Hi Randy,

Thanks for you posting in the group!
Hi, I need to create a simple dll which will be used by
MS Access and .ASP apps... What do you want the DLL to do with the MS Access and .ASP?
a complete example which I
can compile and run with Visual C++ .net?

VC++ Appwizard to create a Managed MFC Regular DLL
http://www.codeproject.com/managedcp...t=create%7CDLL
Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #2
Gary, functions in my dll will perform calculations and
access data then return values which will be used in
MSAccess and .ASP apps. I have a large amount of
existing C code which I'll use in the dll.

-----Original Message-----
Hi, I need to create a simple dll which will be used by
MS Access and .ASP apps. What type of dll would be best
and can anybody point me to a complete example which I
can compile and run with Visual C++ .net?

Thanks,
Randy

.

Nov 17 '05 #3
Hi Randy,

Thanks for your quickly reply!
Gary, functions in my DLL will perform calculations and
access data then return values which will be used in
MSAccess and .ASP apps.


If you want your DLL can be used by ASP pages, I think you should create an
ATL COM DLL, it also can be loaded by Access applications.
For detail information on this topic, please refer to the following docs:

Developing Active Server Components with ATL
http://msdn.microsoft.com/library/de...us/dnasp/html/
comp.asp
Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #4
Gary, I found the following info in the vc++ help
documentation but I can't find the ATL COM AppWizard
anywhere. I have 'file|new|project|visual c++
projects|ATL|ATL project' so am I missing something?
Creating the Module
Creating the module is almost trivial: we select New.
from the File menu, and then select the Projects tab and
fill in the directory and project name. (Make sure you
don't pick the name of the control now-Dr. GUI usually
puts "Mod" at the end of the name to make sure.) Your
project dialog box will look something like the
following. (By the way, Dr. GUI thinks it's no accident
that "ATL COM AppWizard" is the default-or could it just
be first alphabetically?)

....

Creating the Object
Now that we understand the module object a little, let's
add a COM component to it.

The easiest way to add a COM component is to use the ATL
Object Wizard. Just select New ATL Object. from the
Insert menu, and you'll get a dialog box that looks like
the following.

-----Original Message-----
Hi Randy,

Thanks for your quickly reply!
Gary, functions in my DLL will perform calculations and
access data then return values which will be used in
MSAccess and .ASP apps.
If you want your DLL can be used by ASP pages, I think

you should create anATL COM DLL, it also can be loaded by Access applications.For detail information on this topic, please refer to the following docs:
Developing Active Server Components with ATL
http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dnasp/html/comp.asp
Best regards,

Gary Chang
Microsoft Online Partner Support

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

.

Nov 17 '05 #5
Hi Randy,

Thanks for your quickly reply!
and tried to plug in the code for the ToUpper simple
example but can't get it to compile.
After you created an ATL project with the DLL server type, in the ClassView
you can use the Add Class Wizard to add an ATL simple object, give a name,
use the default setting and click finish.
The in the ClassView right click the interface of the added ATL simple
object(e.g.: ICalssName), use Add method wizard to add the sample ToUpper
method.

Can you find an
example for vc++ .net?


The following link has many latest Visual C++ ATL samples:
http://msdn.microsoft.com/library/de...us/vcsample/ht
ml/vcoricategoricallistofatlsamples.asp

Those samples may be not particularly for your ASP pages use, however to
assure the ATL object has Dual interface(ATL object Option), it can be
loaded by ASP pages.
Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #6
Hi Randy,
I can't find the ATL COM AppWizard
anywhere.


In VS.NET 2003, the ATL COM AppWizard is just the ATL Project Wizard .
Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #7
Thanks Gary, I got my dll to build and now I'm trying to
call the dll's function from a c++ app. How do I tell
the app where to find "C:\Documents and
Settings\default\My Documents\Visual Studio Projects\test4
\Debug\test4.dll"? I looked at 'Imports' and 'using' and
project|properties but haven't found the answer yet.
-----Original Message-----
Hi Randy,

Thanks for your quickly reply!
and tried to plug in the code for the ToUpper simple
example but can't get it to compile.
After you created an ATL project with the DLL server

type, in the ClassViewyou can use the Add Class Wizard to add an ATL simple object, give a name,use the default setting and click finish.
The in the ClassView right click the interface of the added ATL simpleobject(e.g.: ICalssName), use Add method wizard to add the sample ToUppermethod.

Can you find an
example for vc++ .net?
The following link has many latest Visual C++ ATL

samples:http://msdn.microsoft.com/library/default.asp? url=/library/en-us/vcsample/html/vcoricategoricallistofatlsamples.asp

Those samples may be not particularly for your ASP pages use, however toassure the ATL object has Dual interface(ATL object Option), it can beloaded by ASP pages.
Best regards,

Gary Chang
Microsoft Online Partner Support

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

.

Nov 17 '05 #8
Hi Randy,

Thanks for your quickly response!
Thanks Gary, I got my dll to build and now I'm trying to
call the dll's function from a c++ app.


I think you DLL is an ATL COM server and automatically registered just
after building.
So you can use it in your C++ application as a COM object(for it actually
is).

If you use a managed C++ application, please refer to
HOW TO: Use ActiveX Components with Managed C++ Projects
http://support.microsoft.com/?id=816151#4

Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #9
How do I tell my c++ app where to look for test4.dll and
it's functions? How will test4.dll's other users declare
test4.dll so they can use it's functions in c++,
msaccess, and .ASP apps on their systems?
-----Original Message-----
Hi Randy,

Thanks for your quickly response!
Thanks Gary, I got my dll to build and now I'm trying tocall the dll's function from a c++ app.
I think you DLL is an ATL COM server and automatically

registered justafter building.
So you can use it in your C++ application as a COM object (for it actuallyis).

If you use a managed C++ application, please refer to
HOW TO: Use ActiveX Components with Managed C++ Projects
http://support.microsoft.com/?id=816151#4

Best regards,

Gary Chang
Microsoft Online Partner Support

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

.

Nov 17 '05 #10
Hi Randy,

Thanks for your quickly response!
How do I tell my c++ app where to look for test4.dll and
it's functions? How will test4.dll's other users declare
test4.dll so they can use it's functions in c++,


If your test4.dll is a pure DLL(not a COM server), you can copy your DLL's
header file and .lib to your c++ program's directory, and include this
header file to your c++ program's header file or source file, then in the
Project\Setting...\Link tab's Catagory selecting Input, then in the
Object/Library Modules' textbox, type the .lib filename.

And meantime you should copy you .DLL file to the directory of the c++
application's exe file.
For .ASP page, it can only comsume the COM object, if you don't know clear
about how to use a COM within ASP, please post the problem to the
.dotnet.aspnet queue.
Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #11
Gary, my property pages show that my project is a .dll
which is statically linked to ATL. How do I declare the
dll in c++, vba, and .ASP app? In vba i tried

Declare Sub rsdm1 Lib "Test4" ()

but get an error even if i copy test4.dll into the folder
which contains the .mdb file.
-----Original Message-----
Hi Randy,

Thanks for your quickly response!
Thanks Gary, I got my dll to build and now I'm trying tocall the dll's function from a c++ app.
I think you DLL is an ATL COM server and automatically

registered justafter building.
So you can use it in your C++ application as a COM object (for it actuallyis).

If you use a managed C++ application, please refer to
HOW TO: Use ActiveX Components with Managed C++ Projects
http://support.microsoft.com/?id=816151#4

Best regards,

Gary Chang
Microsoft Online Partner Support

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

.

Nov 17 '05 #12
Gary, In some vba code I use

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

but it fails with the err

Can't find DLL entry point rsdm2 in C:\Documents and
Settings\default\My Documents\Msaccess\Test4

so what should I check?
-----Original Message-----
Hi Randy,

Thanks for your quickly response!
How do I tell my c++ app where to look for test4.dll andit's functions? How will test4.dll's other users declaretest4.dll so they can use it's functions in c++,
If your test4.dll is a pure DLL(not a COM server), you

can copy your DLL'sheader file and .lib to your c++ program's directory, and include thisheader file to your c++ program's header file or source file, then in theProject\Setting...\Link tab's Catagory selecting Input, then in theObject/Library Modules' textbox, type the .lib filename.

And meantime you should copy you .DLL file to the directory of the c++application's exe file.
For .ASP page, it can only comsume the COM object, if you don't know clearabout how to use a COM within ASP, please post the problem to the.dotnet.aspnet queue.
Best regards,

Gary Chang
Microsoft Online Partner Support

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

.

Nov 17 '05 #13
Hi Randy,

Hope you can review this message:
Gary, my property pages show that my project is a .dll which is statically linked to ATL. How do I declare the dll in >c++, vba, and .ASP app? In
vba i tried
Declare Sub rsdm1 Lib "Test4" ()
but get an error even if i copy test4.dll into the folder which contains

the mdb file.

Which error do you get?
Is your Sub declaration compatible with your DLL's function signature?
And try to specify the fullname(include path name) of the Test4.dll instead
of just "Test4".

Please apply my suggestion above and let me know if it helps resolve your
problem.
Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #14
in rsd2.cpp I have

STDMETHODIMP Crsd2::rsdm2(BSTR* s1)

then in msaccess (vba) code I use

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

but it fails with the err

Can't find DLL entry point rsdm2 in C:\Documents and
Settings\default\My Documents\Msaccess\Test4

Is there some utility I can use to dump the dll's symbol
names and other info to show you? Maybe the dll type
isn't right for msaccess?

-----Original Message-----
Hi Randy,

Hope you can review this message:
Gary, my property pages show that my project is a .dll
which is staticallylinked to ATL. How do I declare the dll in >c++, vba, and .ASP app? Invba i tried
Declare Sub rsdm1 Lib "Test4" ()
but get an error even if i copy test4.dll into the
folder which containsthe mdb file.

Which error do you get?
Is your Sub declaration compatible with your DLL's function signature?And try to specify the fullname(include path name) of the Test4.dll insteadof just "Test4".

Please apply my suggestion above and let me know if it helps resolve yourproblem.
Best regards,

Gary Chang
Microsoft Online Partner Support

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

.

Nov 17 '05 #15
Gary, I tried to run dumpbin.exe on my dll but it fails
maybe because my environment variables aren't set up
correctly.

Here's my build log...

<html>
<head>
<META HTTP-EQUIV="Content-Type" content="text/html;
charset=Windows-1252">
</head>
<body>
<pre>
<table width=100% bgcolor=#CFCFE5><tr> <td> <font
face=arial size=+3>
Build Log
</font></table><table width=* cellspacing=0
cellpadding=0><tr><td width=0
bgcolor=#EDEDF5>&nbsp;</td><td width=0
bgcolor=#FFFFFF>&nbsp;</td><td width=*><pre>
<h3>------- Build started: Project: test4, Configuration:
Debug|Win32 -------
</h3>
</pre></table><table width=100%
bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
Command Lines
</font></table><table width=* cellspacing=0
cellpadding=0><tr><td width=0
bgcolor=#EDEDF5>&nbsp;</td><td width=0
bgcolor=#FFFFFF>&nbsp;</td><td width=*><pre>Creating
temporary file "c:\Documents and Settings\default\My
Documents\Visual Studio Projects\test4
\Debug\RSP000005.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/test
4.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Wp64 /ZI /T
P
".\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\RSP000005.rsp" /nologo"
Creating temporary file "c:\Documents and
Settings\default\My Documents\Visual Studio Projects\test4
\Debug\RSP000006.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/test
4.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Wp64 /ZI /T
P
".\stdafx.cpp"
]
Creating command line "cl.exe @"c:\Documents and
Settings\default\My Documents\Visual Studio Projects\test4
\Debug\RSP000006.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\RSP000007.rsp" with contents
[
/OUT:"Debug/test4.dll" /INCREMENTAL /NOLOGO /DLL /IDLOUT:"
_test4.idl" /DEBUG /PDB:"Debug/test4.pdb" /SUBSYSTEM:WINDO
WS /IMPLIB:"Debug/test4.lib" /MACHINE:X86 /SYMBOLS
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\RSP000007.rsp""
Creating temporary file "c:\Documents and
Settings\default\My Documents\Visual Studio Projects\test4
\Debug\BAT000008.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\BAT000008.bat""
</pre></table><table width=100%
bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
Output Window
</font></table><table width=* cellspacing=0
cellpadding=0><tr><td width=0
bgcolor=#EDEDF5>&nbsp;</td><td width=0
bgcolor=#FFFFFF>&nbsp;</td><td width=*><pre>Compiling...
stdafx.cpp
Compiling...
toupper.cpp
test4.cpp
rsd2.cpp
rsd1.cpp
Generating Code...
Compiling resources...
Linking...
LINK : warning LNK4044: unrecognized option '/SYMBOLS';
ignored
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
Performing registration
</pre></table><table width=100%
bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
Results
</font></table><table width=* cellspacing=0
cellpadding=0><tr><td width=0
bgcolor=#EDEDF5>&nbsp;</td><td width=0
bgcolor=#FFFFFF>&nbsp;</td><td width=*><pre>
Build log was saved at "file://c:\Documents and
Settings\default\My Documents\Visual Studio Projects\test4
\Debug\BuildLog.htm"
test4 - 0 error(s), 1 warning(s)</pre></table><table
width=100% height=20 bgcolor=#CFCFE5><tr><td><font
face=arial size=+2>
</font></table></body></html>
-----Original Message-----
Hi Randy,

Hope you can review this message:
Gary, my property pages show that my project is a .dll
which is staticallylinked to ATL. How do I declare the dll in >c++, vba, and .ASP app? Invba i tried
Declare Sub rsdm1 Lib "Test4" ()
but get an error even if i copy test4.dll into the
folder which containsthe mdb file.

Which error do you get?
Is your Sub declaration compatible with your DLL's function signature?And try to specify the fullname(include path name) of the Test4.dll insteadof just "Test4".

Please apply my suggestion above and let me know if it helps resolve yourproblem.
Best regards,

Gary Chang
Microsoft Online Partner Support

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

.

Nov 17 '05 #16
Gary, I used

cd "C:\Documents and Settings\default\My
Documents\Msaccess"
call "C:\Program Files\Microsoft Visual Studio .NET 2003
\Common7\Tools\vsvars32.bat"
DUMPBIN.exe /ALL test4.dll > t.txt

and the 1st part of t.txt is

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file test4.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
14C machine (x86)
7 number of sections
4002F783 time date stamp Mon Jan 12 12:37:39 2004
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
210E characteristics
Executable
Line numbers stripped
Symbols stripped
32 bit word machine
DLL

OPTIONAL HEADER VALUES
10B magic # (PE32)
7.10 linker version
24000 size of code
11000 size of initialized data
0 size of uninitialized data
11884 entry point (10011884)
1000 base of code
1000 base of data
10000000 image base (10000000 to 10045FFF)
1000 section alignment
1000 file alignment
4.00 operating system version
0.00 image version
4.00 subsystem version
0 Win32 version
46000 size of image
1000 size of headers
0 checksum
2 subsystem (Windows GUI)
0 DLL characteristics
100000 size of stack reserve
1000 size of stack commit
100000 size of heap reserve
1000 size of heap commit
0 loader flags
10 number of directories
3D4A0 [ 1D8] RVA [size] of Export Directory
40000 [ B4] RVA [size] of Import Directory
42000 [ 14E0] RVA [size] of Resource
Directory
0 [ 0] RVA [size] of Exception
Directory
0 [ 0] RVA [size] of Certificates
Directory
44000 [ 12D4] RVA [size] of Base Relocation
Directory
35000 [ 1C] RVA [size] of Debug Directory
0 [ 0] RVA [size] of Architecture
Directory
0 [ 0] RVA [size] of Global Pointer
Directory
0 [ 0] RVA [size] of Thread Storage
Directory
0 [ 0] RVA [size] of Load
Configuration Directory
0 [ 0] RVA [size] of Bound Import
Directory
404D0 [ 41C] RVA [size] of Import Address
Table Directory
0 [ 0] RVA [size] of Delay Import
Directory
0 [ 0] RVA [size] of COM Descriptor
Directory
0 [ 0] RVA [size] of Reserved
Directory
SECTION HEADER #1
..textbss name
10000 virtual size
1000 virtual address (10001000 to 10010FFF)
0 size of raw data
0 file pointer to raw data
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
E00000A0 flags
Code
Uninitialized Data
Execute Read Write

SECTION HEADER #2
.text name
23489 virtual size
11000 virtual address (10011000 to 10034488)
24000 size of raw data
1000 file pointer to raw data (00001000 to 00024FFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60000020 flags
Code
Execute Read

RAW DATA #2
10011000: CC CC CC CC CC E9 56 1F 00 00 E9 7D D9 01 00
E9 ÌÌÌÌÌéV...é}Ù..é
10011010: EC AF 01 00 E9 37 7A 01 00 E9 A2 41 01 00 E9
FD ì¯..é7z..é¢A..éý
10011020: FC 00 00 E9 C8 A5 00 00 E9 D3 6C 01 00 E9 2E
67 ü..éÈ¥..éÓl..é.g
-----Original Message-----
Hi Randy,

Hope you can review this message:
Gary, my property pages show that my project is a .dll
which is statically linked to ATL. How do I declare the dll in >c++, vba, and .ASP app? In vba i tried
Declare Sub rsdm1 Lib "Test4" ()
but get an error even if i copy test4.dll into the
folder which contains the mdb file.

Which error do you get?
Is your Sub declaration compatible with your DLL's function signature?And try to specify the fullname(include path name) of the Test4.dll instead of just "Test4".

Please apply my suggestion above and let me know if it helps resolve your problem.
Best regards,

Gary Chang
Microsoft Online Partner Support

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

.

Nov 17 '05 #17
Hi Randy,

Thanks for your quickly reply!
Can't find DLL entry point rsdm2 in C:\Documents and
Settings\default\My Documents\Msaccess\Test4


The code you posted is using an exported function rsdm2 in the Test4.dll,
however the Test4.dll is a COM in-process server which built by ATL wizard,
not a pure DLL with function exported, so you got this error.

If you want to load an exported function of a dll, you can create the dll
as a Win32 Dynamic-Link Library.
Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #18
Hi Randy

Thanks for your quickly reply!
Private Declare Sub rsdm2 Lib "C:\Documents and
Settings\default\My Documents\Msaccess\Test4" (ByVal s1
As String)
It is a declaration of rsdm2 function which assumed exported from the
Test4.dll(assume not a COM server).

STDMETHODIMP Crsd2::rsdm2(BSTR* s1)


This is a member method definition of your COM class Crsd2, and not an
exported function.
Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #19
Hi, my original question was how to create a simple dll
which will be used by
MS Access and .ASP apps and what type of dll would be
best
and could anybody point me to a complete example which I
could compile and run with Visual C++ .net.

You suggested that I should create an
ATL COM DLL which could also be loaded by MS Access
applications so I tried

file|new|project|visual c++ projects|ATL|ATL project

but it fails with the err

Can't find DLL entry point rsdm2 in C:\Documents and
Settings\default\My Documents\Msaccess\Test4

so now you tell me to use an exported function of a Win32
Dynamic-Link Library. I used

file|new|project|visual c++ projects|win32|win32 project

then I set the configuration type to dll. I can't find a
wizard which will add a method so can you please give me
example code for a method that I can paste into my win32
dll source files and call it from MAccess and .ASP apps?

Thanks
Randy
-----Original Message-----
Hi Randy,

Thanks for your quickly reply!
Can't find DLL entry point rsdm2 in C:\Documents and
Settings\default\My Documents\Msaccess\Test4
The code you posted is using an exported function rsdm2

in the Test4.dll,however the Test4.dll is a COM in-process server which built by ATL wizard,not a pure DLL with function exported, so you got this error.
If you want to load an exported function of a dll, you can create the dllas a Win32 Dynamic-Link Library.
Best regards,

Gary Chang
Microsoft Online Partner Support

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

.

Nov 17 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Deltones | last post by:
Hi all, I'm just getting into Python/wxPython/Pythoncard and I'm trying the tutorial from this page: http://pythoncard.sourceforge.net/walkthrough1.html Is it me who's totally dense or...
1
by: Eliezer Figueroa | last post by:
Full Database System Sample? I want to know if there any good windows forms based database sample application that can be downloaded.I searched the MS site but most of the database samples are...
4
by: Frank_00001 | last post by:
I'm going to need to get a list of users for an upcoming project and Active Directory seems to be a good place to get it. I'm trying to get the "Walkthrough: Viewing Local Directory Objects"...
0
by: Amrit Kohli | last post by:
I am trying to get through the XML Web Services Walkthrough at this location: ...
4
by: Roy | last post by:
Hi all, I know there are asp.net samples code such as Duwamish or Fitch Mather. Is there any sample code for Windows application. Thanks Roy
9
by: dennist685 | last post by:
Walkthrough: Creating a Web Page to Display Access Database Data I've started the above walkthrough. However, near the beginning it gives the following instructions To set permissions in the...
7
by: John D'oh | last post by:
Hello, I have been going through the MSDN Walkthrough: Creating a Windows Forms Control That Takes Advantage of Visual Studio Design-Time Features. Everything was going fine and I was able to...
6
by: Ronald S. Cook | last post by:
I'm able to walkthrough a C# sample for Windows Communication Foundation and all works fine. But when I do it in VB.NET exactly the same way (but with different syntax, of course), I get the...
2
by: Ken Williams | last post by:
WhenI search Internet there thousands of comments and samples for database conenction and tuning. They are all advanced and comprehesive. I didn't found a simple "Hello World" for accessing an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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,...
0
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...
0
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,...
0
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...

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.