How can I Export DllRegisterServer in VC++?

I created a DLL using Win32 API. Now I wanted to export
DLLUnregisterServer and DLLRegisterServer function so that I can use
RegSvr32.exe to register the DLL.

I tried the following syntax. It does not work. The function is not
exported.

__declspec(dllexport) STDAPI DllRegisterServer(void);

I can export other functions using similar syntax.

Any other ideas?

thanks in advance,
Qiang

0
qwu2008 (4)
9/15/2006 9:44:18 PM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
1621 Views

Similar Articles

[PageSpeed] 22

Well, "it does not work" is of absolutely no help in trying to solve the 
issue.

But the only way I know how to do export a function name without any 
modification whatsoever is to create and include a DEF file in your project.

-- 
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

<qwu2008@gmail.com> wrote in message 
news:1158356658.481000.319110@e3g2000cwe.googlegroups.com...
>I created a DLL using Win32 API. Now I wanted to export
> DLLUnregisterServer and DLLRegisterServer function so that I can use
> RegSvr32.exe to register the DLL.
>
> I tried the following syntax. It does not work. The function is not
> exported.
>
> __declspec(dllexport) STDAPI DllRegisterServer(void);
>
> I can export other functions using similar syntax.
>
> Any other ideas?
>
> thanks in advance,
> Qiang
> 


0
jwood (1292)
9/15/2006 10:46:01 PM
<qwu2008@gmail.com> wrote in message
news:1158356658.481000.319110@e3g2000cwe.googlegroups.com...
> I created a DLL using Win32 API. Now I wanted to export
> DLLUnregisterServer and DLLRegisterServer function so that I can use
> RegSvr32.exe to register the DLL.
>
> I tried the following syntax. It does not work. The function is not
> exported.
>
> __declspec(dllexport) STDAPI DllRegisterServer(void);
>
> I can export other functions using similar syntax.
>

Putting it in the Def file might be the easiest. In code, try the following:

EXTERN_C __declspec(dllexport) HRESULT STDAPICALLTYPE DllRegisterServer();

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com



0
ajaykalra (6842)
9/16/2006 12:10:44 PM
Can anyone provide a sample "exports.def"?

thanks,
Qiang


Ajay Kalra wrote:
> <qwu2008@gmail.com> wrote in message
> news:1158356658.481000.319110@e3g2000cwe.googlegroups.com...
> > I created a DLL using Win32 API. Now I wanted to export
> > DLLUnregisterServer and DLLRegisterServer function so that I can use
> > RegSvr32.exe to register the DLL.
> >
> > I tried the following syntax. It does not work. The function is not
> > exported.
> >
> > __declspec(dllexport) STDAPI DllRegisterServer(void);
> >
> > I can export other functions using similar syntax.
> >
>
> Putting it in the Def file might be the easiest. In code, try the following:
>
> EXTERN_C __declspec(dllexport) HRESULT STDAPICALLTYPE DllRegisterServer();
> 
> --
> Ajay Kalra [MVP - VC++]
> ajaykalra@yahoo.com

0
qwu2008 (4)
9/16/2006 7:38:46 PM
Can anyone provide a sample "exports.def"?

thanks,
Qiang


Ajay Kalra wrote:
> <qwu2008@gmail.com> wrote in message
> news:1158356658.481000.319110@e3g2000cwe.googlegroups.com...
> > I created a DLL using Win32 API. Now I wanted to export
> > DLLUnregisterServer and DLLRegisterServer function so that I can use
> > RegSvr32.exe to register the DLL.
> >
> > I tried the following syntax. It does not work. The function is not
> > exported.
> >
> > __declspec(dllexport) STDAPI DllRegisterServer(void);
> >
> > I can export other functions using similar syntax.
> >
>
> Putting it in the Def file might be the easiest. In code, try the following:
>
> EXTERN_C __declspec(dllexport) HRESULT STDAPICALLTYPE DllRegisterServer();
> 
> --
> Ajay Kalra [MVP - VC++]
> ajaykalra@yahoo.com

0
qwu2008 (4)
9/16/2006 7:38:52 PM
"Qiang" <qwu2008@gmail.com> wrote in
news:1158435532.290356.312380@b28g2000cwb.googlegroups.com: 

> Can anyone provide a sample "exports.def"?
> 
> thanks,
> Qiang

Try creating a scratch COM project. (New Project, etc) Then look at what's 
generated. The other way I do it is to look at an MSDN sample.

Doing that is also a good way of finding out "just what does MS do to turn 
on this feature" (where 'this' might be unicode, dependencies, whatever. 
I'll create 2 projects and diff them...

Dave Connet
0
connet1 (33)
9/17/2006 4:08:32 PM
Reply:

Similar Artilces:

Can I make ONE page for Email/Calendar/Task etc?
I like to adapt my screen sothat I have ONE view of Incoming Email/Calendar/Task in small squares?? William Petrovlis <petrovlis@hetnet.nl> wrote: > I like to adapt my screen sothat I have ONE view of > Incoming Email/Calendar/Task in small squares?? I don't think that's possible. -- Brian Tillman Have you tried the Outlook Today view? If it's not in your "shortcuts" list, go to View - Go To - Outlook Today. It might be close... Brian "Petrovlis" <petrovlis@hetnet.nl> wrote in message news:40c4404f$0$827$fb624cd1@morenews.zeeland...

Can I track changes made to a shared file per userid.
I was wondering if I could track who made what changes in a shared excel file. If so, how should I go about it? Thank you in advance! Julie On that same Tools|Share Workbook dialog, there's an Advanced Tab. There's an option (default is On???) that allows you to track those changes. When you're ready to look at the changes, tools|track changes|accept or reject changes (You may already have it turned on.) But be aware that if you keep lots of changes, then excel can slow down. Julie _at_GBS wrote: > > I was wondering if I could track who made what changes in a share...

Can't add additional mailboxes after upgrade 5.5-2003????
Hello, I just recently installed an Ex2003 server in order to migrate from 5.5. I am the only admin in the company so I previously had permissions to open anyones mailbox either as a new profile or as an additional mailbox option in my outlook client. When I try to do this with the handfull of users that have migrated to the new Exchange 2003 server I receive a request to log in. I tried the domain admin account, the exchange admin account, my account nothing seems to work. I must be permissioning something wrong on the new server. How do I fix this so that I have permission to everyon...

How can I get help to make my outlook 2003 to work
The connection to Microsoft Exchange Server is unavailable Outlook must be online or connected to complete this action. (OK) when I click ok a window comes up Microsoft Exchange Server: in th boxes is has earthlink.net and the next box says mail box John XXXXXXXX I'v tried everything and I can't get this to work. All other programs work just fine. Are you connecting to an Exchange server? If not, remove it from your = profile and install your Earthlink POP3 account. --=81 Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicite...

Resolution for logo
I am hoping to send someone an advert to go in a newsletter which is put together in Publisher 2003. It is printed on their home inkjet. I want to get our logo as crisp as possible and I currently have it in eps format, which cannot be used in this case. So after looking through some previous posts what I intend to do is export it in Illustrator CS2 as a png file, then insert it into an advert I have designed in Publisher 2003. I'll then email him the Publisher file all done and ready for him to copy into the newsletter. My query is Illustrator gives me an option to choose the resolut...

Cannot backup or copy outlook 2000 pst file, but can open it.
I have an outlook 2000 file. If I try to backup with backrex, copy it or use the inbox repair tool (scanpst.exe) it reboots the computer. How can I repair this and get a backup. Please remove the .nospam from the email address if responding. Rusty "Rusty" <rburshell.nospam@cox.net> wrote in message news:p82pg1p4ak4bjpeuc6ava0v9n0pifqkpoj@4ax.com > I have an outlook 2000 file. If I try to backup with backrex, copy > it or use the inbox repair tool (scanpst.exe) it reboots the computer. > > How can I repair this and get a backup. > > Please remove the .nos...

HELP! Exchange server can add feeds but not download items. Any thoughts?
I have configured Exchange to use the NNTP service which works fine on the server but when I add a feed it can connect to the server and replicate the folders, but then i get "STATUS IS FAILURE" when it goes to download the messages. Any thoughts? ...

Can send new email but cannot reply.
Windows XP Professional SP2, Outlook 2003 SP2 connected to Exchange 2003 SP2 I can send a new email to an address but get the following message when replying. No attachments and it was occuring only occasionally but now on all. The following recipient(s) could not be reached: 'target email address' on 5/2/2006 1:02 PM 550 not local host aol.com, not a gateway Thanks for any help. Marc Miller Marc Miller <mjmiller@mjmtech.net> wrote: > Windows XP Professional SP2, Outlook 2003 SP2 connected to Exchange > 2003 SP2 > I can send a new email to a...

Can't Edit Status of PO Lines
I have a PO on which a few of the lines cannot have their status changed. A Receipt has been created and posted as far as I can tell (there are no unposted batches...the receipt has a batch assigned to it...so I would think that means the batch was posted). For the item on the PO, the Status is "Released". If I attempt to change that to "Received" (or anything else), I get a message saying: "You can't change the status of this line item; it has unposted receipts assigned to it." Does anyone have any idea how to go about correcting this? On ...

Optimization on FileReading in VC++
Hi, I am working with File reading in VC++. I am reading a log file which has around 1 lakh records. I have to read each record and filter them based on some options and display them on the UI. The problem that I am facing is that it takes enormous amount of time to read so many records. I am using CStdIOFile for reading. Can any one please help me with some optimization techniques that will speed up my reading process. Thanks Madhavi. ...

using vista mail program with earthlink http mail: error message when sending, can you download mail without deleting from server
i get the following when trying to send mail through earthlink: An unknown error has occurred. Subject 'test7', Account: 'pop.earthlink.net', Server: 'smtpauth.earthlink.net', Protocol: SMTP, Server Response: '550 Your message does not conform to RFC2822 standard', Port: 587, Secure(SSL): No, Server Error: 550, Error Number: 0x800CCC69 earthlink has instructions for setting popmail and sumupath numbers on their site which i followed. also is there any way to download mail without deleting it from server? thanks. Your question may be better answered ...

Can I change the display of comments?
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I have my comments showing when I roll over them with my mouse, but I would like to remove the name, date, and time of the comment from the display. Using balloons is not an option because some pages have too many comments. Iggles14@officeformac.com wrote: > Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: > Intel I have my comments showing when I roll over them with my mouse, > but I would like to remove the name, date, and time of the comment from > the display. Using b...

How can I print a list of birthdays from my Outlook Contacts?
I am trying to print a list of all the birthdays I have noted in my Contacts .... can this be done? Mail merge to a directory provides the most ways to customize printing of Outlook data. -- Russ Valentine "LXD" <LXD@discussions.microsoft.com> wrote in message news:CF91C4C1-0DBA-4C09-9579-7DB6064DAE04@microsoft.com... >I am trying to print a list of all the birthdays I have noted in my >Contacts > ... can this be done? ...

can I make access remember a last unbound number
I want to 'store' a number (which changes frequently) in an unbound text box, but do not want it stored in any tables. Can this be done? The number is used to reference a user start point, but I want it to still be there when the database is reopened. "efandango" <efandango@discussions.microsoft.com> wrote in message news:A5F6D14E-3B48-4DD5-8A7E-3C6477AE8B01@microsoft.com... >I want to 'store' a number (which changes frequently) in an unbound text >box, > but do not want it stored in any tables. Can this be done? > > The number is...

Can you get box plots on excel?
Can you get box plots (box and wisker diagrams) on microsoft excel? Jon Peltier has instructions for creating Box and Whisker plots: http://www.peltiertech.com/Excel/Charts/ComboCharts.html#BoxWhisker yankovic-kid wrote: > Can you get box plots (box and wisker diagrams) on microsoft excel? -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html ...

Can I create a thread safe Winform User Control
Hi, I know that if I want to update a Windows Form Control from a worker thread I need to check InvokeRequired on the control and jump through some hoops. I can get that all to work. But, I wonder if I can make a User Control which inherits from for example, System.Windows.Forms.Label, and has the correct thread safe set method built in? In fact, why are Windows Forms controls not thread safe? It seems like it would have been pretty easy to build in, at least for the their simple properties, and would save a fair amount of fiddly work on the developer's part. Thanks, ...

Can Exchange 2003 server host multiple AD domains email
I have two domains that share a trust. One domain has a 2003 Exchange server. I would like this email server to host mail for the trusted domain also. Can the Exchange server host mail for both domains. -- bltmayo I'm assuming you are talking about domains as in "Active Directory" and not SMTP. Are these two domains in the same AD forest? If so, yes, easily. Run SETUP /DOMAINPREP on the other domain, then create an additional RUS in your Exchange System Manager that points to a DC in the other domain. If it is a separate domain, you can still do this, but you will nee...

How do I move a public calendar to a group so others can share it?
I am trying to move meeting room calendars that are currently located in public folders to a group called "Meeting Rooms." It appears that I have duplicated a calendar so that when someone schedules a meeting it goes to the copy and not the original meeting room calendar. ...

Can't edit individual controls after using Form Tool
How can I edit individual controls after using Form Tool (e.g. sizing afects all like controls) Jim T wrote: >How can I edit individual controls after using Form Tool (e.g. sizing afects >all like controls) Well you didn't give us much to go on, so I'm going to take a wild stab and guess that you're using A2007 and you have a set of controls that are grouped, and you want to remove the grouping? If so, select the controls in question, go to the Arrange tab, then select Remove on the ribbon. -- ________________________ Sean Bailey Message posted via ...

How can i choose the USB voice device instead of the default microphone and speaker device in MFC programming?
in one MFC programme,there are two voice device,one is USB device,the other is default microphone and speaker,how can i choose the USB voice device in MFC programming when this programme stared? ������ wrote: > in one MFC programme,there are two voice device,one is USB device,the > other is default microphone and speaker,how can i choose the USB voice > device in MFC programming when this programme stared? > > You can enumerate audio devices with waveInGetNumDevs and waveInGetDevCaps. The DeviceID used in these functions (0...[num-1]) can be passed to WaveInOpen to ...

How can macro open daily generated files?
Hi all, please can anybody help me with xls macro? I receive on daily basis txt files with name that contains actual date. Typically "Data_20100120.txt". I want to use macro, open files, modify data and add them to another workbook. That's no problem, but I don't know, how to daily open files with different name (date). I am not sure, how can I modify open sentence..... Workbooks.OpenText Filename:="C:\Data_20100120.txt" Many many thanks for your help. Valdemar Give this a try: myDate = Format(Date, "yyyymmdd") Workbooks.OpenTe...

Can I stop the footer from indenting?
The footers in my spreadsheet seem to be indented differently from the main spreadsheet margin. Does anyone know a way to get the footers to align to the same margin as the data? (I'm OK if it's a VBA solution too!) Cheers M Mine showed the left footer was one space to the left of the automatic page margin, so I put a space in front of my left footer and then it was aligned. Are you looking at your left footer or your center footer? If it is your center footer, you would have to add spaces to the right of any text to move the text to the left. Using space...

Can you use a hanging indent in an Excel cell?
I am trying to create a list in Excel but some descriptions are lengthly. It would be easier to distinguish between each item if, as a description wraps in the cell, a hangin indent was in place. Hi DBTI Hanging indents no, indents yes To create a hanging indent look alike, type five spaces before your text. "DBTI" wrote: > I am trying to create a list in Excel but some descriptions are lengthly. It > would be easier to distinguish between each item if, as a description wraps > in the cell, a hangin indent was in place. ...

Can not run report after install frontpage server extension
Hi all, I have a problem with can not run report install frontpage server extension. The error msg display as below. System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: The permissions granted to user 'LOCUS-CRM\IUSR_LOCUS-CRM' are insufficient for performing this operation. ---> Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to user 'LOCUS-CRM\IUSR_LOCUS-CRM' are insufficient for performing this operation. --- End of inner exception stack trace --- at Microsoft.ReportingServices...

Can't Send mail in Outlook after installing ME
I recently install me on and old laptop, now I can recieve mail but can't send any mail. I get a message saying that a nxpext32.dll is missing. How do I recover that dll. http://support.microsoft.com/default.aspx?kbid=196634 -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com "Steve" <srussell@waterw.com> wrote in message news:1b74601c420c1$38dfe230$a501280a@phx.gbl....