include dll in c++

Hi All,
i create a GenDll.dll with mfc wizard.
with the following export attributes:
1) i declared a class with the (at dll project)
    "class DllExport  CTestedClas
     {
       CTestedClas();
     } "
   thats i done on my dll file.

in order to use this dll  .
i keept the following steps:
1) on my project (that using dll functions)
   i entred the GenDll.lib file in project -->setings-->link-->object 
library module.

3) and declare "class DllImport CTestedClas* tt" ;

4) when im done :
       tt= new CTestedClas();
 i've got the error 
  "no appropriate default constructor available"

what i have done wrong

p.s
 if you have any example how can i import a full class from 
dll i will appriciate it.

Thanks

0
gabi (20)
10/31/2004 10:20:02 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
320 Views

Similar Articles

[PageSpeed] 57

"Gabi" <Gabi@discussions.microsoft.com> wrote in message
news:6B9336B7-9EB4-4F4D-BE02-311B736AEB77@microsoft.com...
> Hi All,
> i create a GenDll.dll with mfc wizard.
> with the following export attributes:
> 1) i declared a class with the (at dll project)
>     "class DllExport  CTestedClas
>      {
>        CTestedClas();
>      } "
>    thats i done on my dll file.

I think this should be something more like...

    class DllExport CTestedClas
    {
    public:
        CTestedClas();
    };

>
> in order to use this dll  .
> i keept the following steps:
> 1) on my project (that using dll functions)
>    i entred the GenDll.lib file in project -->setings-->link-->object
> library module.
>
> 3) and declare "class DllImport CTestedClas* tt" ;

Then, I think you need to replace this with...

    class DllImport CTestedClas
    {
    public:
        CTestedClas();
    };

>
> 4) when im done :
>        tt= new CTestedClas();
>  i've got the error
>   "no appropriate default constructor available"
>
> what i have done wrong

I think it's that you have not let the compiler see the class declaration.

-- 
Jeff Partch [VC++ MVP]



0
jeffp (1711)
10/31/2004 10:52:05 AM
Reply:

Similar Artilces:

DirectShow and Visual C++ 6.0
Hi everyone, i need to know if i can use the directshow of directx 9.0 within the Visual C++ 6.0 or that it can be used only with Visual Studio .Net. Thanks in advance. Emanuele, > i need to know if i can use the directshow of directx 9.0 within the Visual > C++ 6.0 or that it can be used only with Visual Studio .Net. It should work just fine with VC6, DirectX is not .net specific technology. See: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/directx9cpp.asp -- Regards, Kobi Ben Tzvi "Emanuele" <eman1975@libero.it> wrote ...

SNMP Extended DLL
I had created SNMP extended DLL. I make it's registration with the same reg file. Reg file contains: REGEDIT4 ; To register this DLL with Microsoft SNMP service [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\ Parameters\ExtensionAgents] "MyAgent" = "SOFTWARE\\xAgentBuilder ExtensionDLLs\\MyAgent\\CurrentVersion" [HKEY_LOCAL_MACHINE\SOFTWARE\xAgentBuilder ExtensionDLLs\MyAgent\CurrentVersion] "Pathname" = "D:\\MyAgent\\DLL\\MyAgentD.dll" "Load" = dword:00000001 "Name" = "MyAgent" I put the same DLL an...

DLL
XP SP3. I have writing a Win32 DLL used by an application. However, once it loaded, how do I 'stop' or 'unload' it? Because when I re-compile my source code, it couldn't. Only if I restart my pc. Shut down all applications that use the dll or go to task manager to forcable shut it down... -- The Top Inno Setup Script Generator - http://www.randem.com/innoscript.html Free Utilities and Code - http://www.randem.com/freesoftutil.html ...

Problem Importing DLL function
Hello, I have a very strange problem. I am trying to import a function from one DLL and use that function in another DLL. I am trying to get a function from 'exdll.dll' and use it in 'msvg.dll'. This is what I am trying to do: --------- export part (from exdll.dll): -------------- extern "C" __declspec (dllexport) long CallDlg() { AFX_MANAGE_STATE(AfxGetStaticModuleState()); CMain* dlg; try { dlg = new CMain(); dlg->Create(IDD_MAIN); dlg->ShowWindow(SW_SHOW); } catch (CMain* dlg) { delete dlg; } return 0; } --------- import part (into msvg....

please help me to fix this mapi32.dll
Hi there, =20 I really hope that you could help with this.. I've been=20 searching all over the place to find a simple answer =20 I have this message when open up Outlook 2000 and=20 sometimes when I open a new Windows XP Pro session "The procedure entry point WNETEnumCachedPasswords could=20 not be located in the dynamic link library MPR.DLL" What can I do to solve the problem? Except for that message, everything seems to be working=20 just fine..=20 I saw in other chatroom that this has to do with the=20 CorelDraw 7 that I've installed. It's now uninstalled =20 I have...

Obtain Members of a Distribution List Outlook 2003 c#
Hello, How do I obtain Members of a Distribution List in Outlook 2003 via c#? Ive found some samples but they only seem to work in 2007 :) I'm wondering if someone can help me. Thanks If you have a DL item use the GetMember() method. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Falko" <Falko@discussions.microsoft.com> wrote in message news:28E69EA2-6ADC-44B0-AE1B-10C57169885F@microsoft.com... &...

How do Load at Run Time DLL's work?
In the example of dll's loaded at runtime they use LoadLibrary and GetProcAddress. The LoadLibrary works for me, but the GetProcAddress doesn't. Well it did for a short time yesterday for no apparant reason, then it quit and wont work today. Anyway, when it was working, the parameter wasn't passed correctly to the dll function. So how does the compiler know what the parameter list is for the dll function? I don't have an h file included or anything to tell the calling program what the parameters can be. Here some some code from the dll In MEP.h class CMEPApp : public CWinApp...

Is there a way to lock out the format for the cell and still allow data entry and C&P?
I've set the spread sheet and have locked all the cells but those that I want to have filled with data. There are time when I would like to be able to C&P the data to other sheets but when I do I also copy the format. I know I can use "paste special" but I want it so anyone can use the C&P without having to use "paste special". Marc Hi, You could write a macro that uses a string for the cell values. sub cpme() dim strCP as string strcp=range("A1").value strcp.copy range("A2").paste end sub I am a bit rusty but this sub should give y...

how can I find and download a WAB DLL file for Outlook 2000
When trying to use outlook I get a error message "cannot find WAB DLL" I may have accidently removed it. What OS are you using? Curious since OL2000 isn't Vista compatible. "JEJE" <JEJE@discussions.microsoft.com> wrote in message news:E344280E-7FEC-4550-8255-E1069D4A8621@microsoft.com... > When trying to use outlook I get a error message "cannot find WAB DLL" I > may > have accidently removed it. if you are using vista, see http://www.outlook-tips.net/howto/vista_wab.htm otherwise, we need to know the version of windows. -- Diane Po...

using MSXML4 and C++ .. #2
Hello everyone, I am using msxml4 and I am curious how I could about creating an element that looks something like <A attr1='a' attr2='b' /> By using the startElement and the endElement defined in http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/a2c70b1a-b2fe-4f5b-8e82-ce96e48bee79.asp I get something that looks like: <A attr1='a' attr2='b'></A> I was hoping it look like the top example. as of now, I have a ContentHandler and an Attribute Handler. any ideas? I have tried googling it and I haven't had any...

force charts to include data points with no data
hi guys, using SQL2005 and SSRS2005. I have an aggregated chart that has volume on the X axis and weeks on the Y axis. I also want to produce in the same report some supporting charts for the unaggregated data, however if there is no activity for a particular business unit for a particular week then that data point is dropped from the chart which means you cannot compare charts easily as the weeks do not line up. I don't really want to go back to the data source to force null data points as the data source is also used for other things. does anyone know if it possible to for...

missing wab dll first time using outlook 2000
while trying to install outlook 2000 for the first time I get a missing dll file message. A computer search did not turn up any wab file. I have a new phone (droid) I am trying to set up a sync with it from outlook Applies to Vista and Windows 7 when it comes to this *.wab error See the following about Outlook 2000 and missing *.wab http://www.outlook-tips.net/howto/vista.htm -- Peter Please Reply to Newsgroup for the benefit of others Requests for assistance by email can not and will not be acknowledged. "airport mark" <airport mark@discussions.microsoft.c...

Fowarding a message without including original text received.
Dear Sirs How do I forward a message without including the original text in the mail received? ...

SQL 'for xml' and C# example??
I'm missing some piece of the puzzle. I'm using 'for xml' type queries from SQL2K - and now trying to change the front-end from ADO to C#, I can't quite figure it out.. It seems that I could use an XmlReader.. and somehow use that instead of a DataReader.. but that didn't work.. I tried using a DataReader and get the byte array - but that wasn't right. SQL returns formatted XML, I need to load that XML into an XmlDocument somehow without ANY molestation of that dom. Any ideas? Examples? Missing links???? thanks THANKS!! I've been looking for the answer to ...

Extension dll implicitly linking with another extension dll
I have an extension dll that implicitly links with a second extension dll. All seems to work fine, however, in the second dll if I call AfxGetApp() it returns NULL. I'm trying to determine why the resource chain isn't being set in the second dll. An app links with the first dll, and the first dll links with the second dll. If I call AfxGetApp() in the first dll it returns me the correct info, but if then the very next line (in the first dll) I call a function insidde the second dll, which then calls AfxGetApp(), it simply returns NULL. I have even tried putting AFX_MANAGE_STATE(Afx...

sevice packs not included in windows update??
I am running windows vista home premium and have had to reinstall. When going through the windows update the service packs dont show up. do i need to download and install manualy? -- smills98823 Windows Vista and Windows Server 2008 service packs are not available for installation through Windows Update: http://support.microsoft.com/?kbid=948343#method5 smills98823 wrote: > I am running windows vista home premium and have had to reinstall. When > going through the windows update the service packs dont show up. do i > need to download and install manualy? >...

PLEEEEEEEEEEEEEEEAAAAAAAAASE HELP!!! Runtime error C++
Can anyone help me? Whenever I open Outlook, i get a message: Microsoft Visual C++ Runtime error - 'application requested runtime to terminate in unusual way.' Please, if anyone has a solution, please post message on forum or preferably, email at me: shakespeareansonnet@hotmail.com I'm having the same problem. I'm running Outlook2000 on XP Home Edition. If I close the error message dialog box and start Outlook a second time, the programs starts without the error message ! >-----Original Message----- >Can anyone help me? Whenever I open Outlook, i get a >m...

Unit testing of WDK driver utility DLL function
I am at a loss rigth now! I have a utility DLL for a Port monitor compiled with the WDK and want to write Unit tests for exported functions in VS 2008. When I am linking the LIB in VS and compile the Unit test DLL with the function in question I am getting an unresolved external error with the reference to this name (__imp_?IsGoodBasePortName@CMYUTILS@@QAEHPA_W@Z) and apparently is different from the name in the library (?IsGoodBasePortName@CMYUTILS@@QAEHPAG@Z). I assume it has something to do how the DLL was compiled but don't know what I can do about it. Hope someone ca...

MS Access 2007 ends unexpectetly
Dear all, I developed a program in MsAccess 2003/2007 (SP2). It calls a VB6 DLL. Both office versions call the DLL, Office 2003 does not have any problem. Same DLL is called in Excel macros (add-in) and works ok, so there seems to be no problem with VB6 DLL. On some computers with MS Access 2007, program runs ok. On some others, when program in MSAccess 2007 opens, first MSAccess form calls a form from VB6 DLL. The VB form opens for checkings and calls a second VB form if checks were ok. When second VB form opens, it seems FORM_LOAD event is executed, I can see the form bu...

Money 2004 crash in mnyob99.dll with new file
I just upgraded to money 2004. Whenever I created a new file (via File->New File), money crashes and the system (XP) reported the fault was in mnyob99.dll. This means that I won't be able to create any new money file at all. I also followed some earlier message by opening the sample money file, it works, but then it still crashed when I tried to create a new file. I searched suport.microsoft.com and did not find anything that would solve the problem. Please help. Thanks. MJ - I have a very similary problem installing money 2003, and the suggested help provided to me in an earlier mes...

Cannot compile eConnect C# sample...
To whom it may concern, I am trying to compile "CSharp eConnect Sales Order Example". But, I get the below error. I have listed the offending line as well as the entire code listing. I would appreciate any help here. Thanks, Larry //Compile time error: C:\TW_PROTOTYPE\test_eConn1\gp_order.cs(136): Cannot implicitly convert type 'Microsoft.GreatPlains.eConnect.Serialization8.SOPTran sactionType' to 'Microsoft.GreatPlains.eConnect.Serialization8.SOPTransa ctionType[]' //Offending line: SOPTransactionType[] MySopTransactionType = (salesOrder); // Entire co...

How do I get and install the PSTPRX.dll file for Office XP?
I am missing the pstprx.dll file in Outlook. Need help in finding the file and installing. Can't use Outlook untill this file is installed. Any ideas? Alex 1.. Close Outlook XP 2.. From Control Panel, double-click Mail . 3.. Click Show Profiles 4.. Remove All profiles. 5.. Click Ok. 6.. Run this to reconfigure your mail account: \\cern.ch\dfs\applications\CERN\OLExchg\OLxpForCERN.vbs Sharath "Alex" <Alex@discussions.microsoft.com> wrote in message news:12D571A6-6679-4FA0-8184-ACB9E3CA7633@microsoft.com... >I am missing the pstprx.dll file in Outlook...

Debugging a DLL
Hi, I have a simple VC++ MFC Dialog based app. I am using third party DLL to connect to a server. The DLL is generating exceptions using printf(...) [obsolete design but I have to use this], Now my app starts and generates no exceptions. It has one onMsg() call back function, which is passed to DLL as setMsgCallback(). Still there is no exception. My app runs fine and sends data to server. However, onMsg() is never called. Whetever I do its never called back. Other sample non MFC based app, like console app are working fine using this DLL and onMsg() is called in them. I have the option to ...

msisam10.dll #2
Uninstalling money2004standard (disk came with the machine from H-P) and re-installing money 2005 standard (from the Wal-Mart) cured the problem. 2005 works fine, though a bit confusing. No loss of data...evidently there was nothing wrong with my backup files. $20 v. about 4 days lost productivity. Thank you Cal Learner! ...

Required .dll file not found
When I try to open Microsoft Money, I get a message that a required .dll file: mspfctl0.dll cannot be found. Does anyone know what I should do to fix this? >-----Original Message----- >When I try to open Microsoft Money, I get a message that a >required .dll file: mspfctl0.dll cannot be found. Does >anyone know what I should do to fix this? >. >Open the Sample File from the Microsoft Money Folder in the Local Disk Drive ...