import vs include

So the difference between import and include is that:

import = used for binary library like DLL or .Lib files. it's very
similar to include that it load all the header (function definition)
from the DLL file so that we can use the header file just like include

include = just include header (source file)

==========================

#import "c:\Program Files\Common Files\System\ADO\msado15.dll" \
              rename("EOF", "EndOfFile")
0
worlman385 (21)
3/27/2008 7:17:27 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
607 Views

Similar Articles

[PageSpeed] 8

worlman385@yahoo.com wrote:
> So the difference between import and include is that:

There is no "import" in Standard C++ (since you have posted this in
'comp.lang.c++', I feel obligated to let you know).

> [..]

V
-- 
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask 


0
v.Abazarov (15)
3/27/2008 7:19:39 PM
worlman385@yahoo.com wrote:
> So the difference between import and include is that:
>
> import = used for binary library like DLL or .Lib files. it's very
> similar to include that it load all the header (function definition)
> from the DLL file so that we can use the header file just like include

#import directive processes a COM type library and generates two C++ 
source files from it - libraryName.tlh and libraryName.tli. It then 
behaves as if .tlh file was #include'd at the point where #import 
directive appears. You can open these files in a text editor, it might 
be instructive.

A type library can be in a standalone .TLB file, or can be bound as a 
resource do a .DLL or .EXE file. #import handles any of these cases.
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925


0
itandetnik (127)
3/27/2008 7:28:19 PM
#import is a Microsoft extension.  And you are obviously confused about what these do.

#include simply includes text in the source stream.

#import ONLY works if you have a type library, that is, an ActiveX or COM control.  When
you apply it to a .exe or .dll file, it searches for a type library resource.

Since ordinary interfaces do not use typelib structures, this serves no purpose.  It
certainly will not apply to .lib files, at least as illustrated.  Of the types listed,
they are

A .tlb or .odl file
A progid of a control in a type library
The library ID of the type library
An executable .exe file
A library .dll file contaninig a type library resource (such as an .ocx)
A compound documnt holding a type library
Any other file forat that can be understood by the LoadTypeLib API

This includes:
If the file is a stand-alongtype library implemented by typelib.doo, the dll is loaded
direfctly
If it is a DLL or EXE it is loaded

I really didn't find a coherent reference as how this migtht be done


As such, they appear to ahave little relevants for modest projects, so 80K.220K can
usually be handled by simple algorithms. #include works well if you deal th the powerpf
good design
Make sure you havenot confused the roles of #import directives/
..
On Thu, 27 Mar 2008 12:17:27 -0700, worlman385@yahoo.com wrote:

>So the difference between import and include is that:
>
>import = used for binary library like DLL or .Lib files. it's very
>similar to include that it load all the header (function definition)
>from the DLL file so that we can use the header file just like include
>
>include = just include header (source file)
>
>==========================
>
>#import "c:\Program Files\Common Files\System\ADO\msado15.dll" \
>              rename("EOF", "EndOfFile")
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
3/28/2008 3:37:20 AM
On Mar 28, 5:17 am, worlman...@yahoo.com wrote:
> So the difference between import and include is that:
>
> import = used for binary library like DLL or .Lib files. it's very
> similar to include that it load all the header (function definition)
> from the DLL file so that we can use the header file just like include
>
> include = just include header (source file)
>
> ==========================
>
> #import "c:\Program Files\Common Files\System\ADO\msado15.dll" \
>               rename("EOF", "EndOfFile")

#import is used for .NET Framework.

Look up the MSDN or goodle. Don't ask to these C++ maniacs they are
gonna get pissed off =P

Cheers,
Alexander D. B. Kim
0
alexdbkim (1)
3/28/2008 6:22:37 AM
Reply:

Similar Artilces:

Fixed Asset Import
I am trying to import Fixed Asset records using Integration Manager 10.0 and I am running into the following error message: Description = The UpdateIfExists parameter is set to 0 and you are attempting to integrate a record that already exists in the FA00100 table I would like to be able to update. Does anyone know how I can change this to allow for insert and update functionality? Unfortunately the eConnect Requester setup tool does not have that table as an option to update. Thanks, Craig Craig: I don't use integration manager so I apologize if this is diffferent but I do use ...

number of fields exceeds 256 when importing from a dbf file
Hey evryone, I'm having a small problem with importing some old data from a FileMaker Pro database. According to what I found out in the groups archive the best bet is to convert it to a dbf file and then import it. However, I the number of fields in the dbf file exceeds 256, so the import wizard truncates the import at field number 256. I would now want to spread the data over two sheets. However, in the process of converting it to a dbf, quite a few of the field names get truncated and therefore have the same name, so I can't use SQL to retrieve them. My question is: what i...

Importing data into public folders
I am trying to get my old calendar data into a public folder i can copy the items one by one but that is taking to long is there anyway to get a pst or data file into a public folder I know i can copy the calendar folder into public folder but then it has a folder inside of a folder just trying to create one calendar folder "TOG2005" wrote: > I am trying to get my old calendar data into a public folder i can copy the > items one by one but that is taking to long is there anyway to get a pst or > data file into a public folder In news:0797FD35-C581-48A4-9E15-D5AEFB...

Import Message Rules from OE
Hi, I tried to import message rules from OE, but only two of nine rules got to OL. when I tried again the same rules where duplicated. Thanks, AJS AJS <newsgroup@sorga.com> wrote: > Hi, I tried to import message rules from OE, but only two of nine > rules got to OL. when I tried again the same rules where duplicated. Outlook and Outlook Express use different rule engines and not all of the rules OE supports can be imported into Outlook. Describe one of the rules that didn't import and perhaps someone can tell you why it didn't. -- Brian Tillman ...

Outlook Express Vs. Outlook
I have a question as follows, I'm using Windows XP Pro, Norton Internet Security 2004, having more than 13,000 messages in a lot of folders but none of them in the system folders like Inbox, Sent Items, Deleted Items, to prevent corruption and the problem I have with OE is that it opens very slow, and when I change between folders it may take 3 seconds or so to change, or if I want to move a message to a different folder it also takes time, Now I have once imported the massages into Outlook, and every thing went fine, I was able to change between folders in less than a second, so my questi...

Importing old MS Mail folders
I need to import the shared folders and global address book from an old MS Mail postoffice. I have seen some discussions concerning migrating mailboxes but very little at that. Can anyone point me in the right direction? THanx! ...

Import Charts into Powerpoint
I have created an Excel workbook that contains over 100 charts. Now I want to import these charts into Powerpoint. What would be the most efficient way to do this? thanks Mike Mike - I guess you'd be wanting some kind of macro. I have some hints on my web site: http://peltiertech.com/Excel/XL_PPT.html If you had something different in mind which you couldn't figure out from these examples, post back. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services http://PeltierTech.com/Excel/Charts/ _______ Squid wrote: > I have created an Excel workbook t...

New Messages includes Attachment! WHY!
One of our uses was playing around with outlook and now when ever she replys to a message or creates a new message there is an attachment on the page. It is always the same one and she can just delete it. I try to go and edit her signature options but the option is grayed out! Please help! Thanks ...

QUICK CAMPAIGN COMPLETE VS SUCCESS
For Quick Campaigns we need: # Complete – (Complete/Sent) # Incomplete – # Pending (Draft/Scheduled/Open, etc) Currently only know how many "successes" (were created) not how many are done. We also need a way that would allow us to action (Campaign E-mail, Letter, Task, etc) or Save as Completed a group of selected Sales Activities (Appointments, E-mails, etc) en-masse once they’ve been created as a result of a Quick Campaign. Some forget to tick the Campaign E-mail button (and create Drafts rather than sending). ---------------- This post is a suggestion for Microsoft, an...

How can I NOT include relationship columns in child nodes?
I am trying to create an XML file with nested 'child' data. I have multiple columns that comprise the data relation(s). How can I NOT include the related columns in the child nodes? Code below (should be able to cut, paste, and run directly). ------------------------------------------------------------------------------ -------- 'Instantiate a new dataset. Dim MyTrx As New DataSet 'Name the dataset. MyTrx.DataSetName = "OUTPUT" 'Add a transaction table. Dim dtTransaction As New DataTable &...

Error when trying to import Report (rdl) into CRM v4
Hi there, I am getting a generic "An error has occurred" when I try to import a report to CRM. (Nothing in the event log) If the report was originally created in CRM and i don't modify it, then i can import the report fine but as soon as i modify it, for example, by creating a new dataset and try to import it. It will fail. Any ideas? The CRM reports are not sufficient for my needs so i need to figure out how to import reports that will work for my requirements. Thanks. -- Linna Tomlinson Sr Client Service Specialist GaleForce Solutions Inc Linna , if report is sh...

table import accounts quick journal
how can I import the GL-accounts into the quick journal setup You would have to do this behind the scenes or using Table Import. You must have a lot of accounts to put into it. -- Charles Allen, MVP "Toni" wrote: > how can I import the GL-accounts into the quick journal setup Which table (tables) I have to use. I have a lot of accounts. I only found to set up the ID with the offset account, but I need to import all the other accounts also. Thanks. "Charles Allen" wrote: > You would have to do this behind the scenes or using Table Import. You must > ha...

Importing CSV files #3
Normally when you click on a csv file excel opens it witout problem. However I have one user who when they click on the csv file finds that it open in an unformatted state. In order to open the file properly she has to go through the import process and place a tick in the comma section. When this is done all the data is formatted correctly. I am able to open this file without problem on my machine. In order to try and fix this I uninstalled and reinstalled office. I also tried doing it under another profile on the same machine to see if it was a profile problem. It also failed. ...

Importing ACT v5/2000 Contacts AND Notes into Outlook 2003
Hi I am trying to import ACT 2000 contacts (including notes) into Outlook 2003 and the notes are not coming in. I have exported 3 records into a little separate ACT v5 database format and verified that the 3 records have notes in them. Then I have tried to import this database into a new Outlook profile and though the Contacts appears, the notes do not Any ideas Thanks in advanc Nitesh Two suggestions: Try using Access as an intermediary between ACT and Outlook. That way, you can check if notes truly do appear in the export (I have not had luck with transferring notes and I have done this...

how do i change or make this macro??? pictures and code included
i need to either make this from scratch or change it to suit my needs. Firstly a link to the template it is from http://www.exinfm.com/excel%20files/FY2000WhatIf.xls the code is Sub projection() Dim revgrowth As Single, costpercent As Single, smgrowth As Single devgrowth As Single, gagrowth As Single Dim intincome As Integer, noncontitems As Integer, otherexps A Integer Dim taxrate As Single, avgshares As Integer 'dialog box gets displayed With DialogSheets("dialog3") If .Show = False Then Exit Sub End If revgrowth = .EditBoxes(1).Text costpercent = .EditBoxes(2).Text smgrow...

OnInitDialog() in VS 2005
Hi, In VS 2005, I want to add a function OnInitDialog() to handle WM_INITDIALOG for a dialog. When I check the dialog's property, WM_INITDIALOG is missing from the message list while many other messages (e.g. WM_CLOSE) that were in VC++ 6.0 are still existent. Do we not do OnInitDialog() anymore in VS 2005? The online help still mentions WM_INITDIALOG. Your help is appreciated. JD Are you looking at the properties for a dialog template, or are you looking at your CDialog-derived class? "JD Young" <jdt_young@yahoo.com> wrote in message news:Ob3FLfP6HHA.536...

Parent vs Child
Is there a way when making an on hand report to just show the Parent for all items instead of it seperating all out in the different "child" items? Hi CT, I'm editor of the Microsoft Business Solutions Community site (www.microsoft.com/businesssolutions/community) and we're having a Microsoft developer from the RMS team answer questions like yours on ITEMS this week. We'll post the answers to the site the week of 9/8 (though if you like, I can fwd the answer to you sooner). Would you like me to pass your question on to Jimmy Wong, the MSFT developer doing this ...

European vs american date notations
Hi, I have a strange problem in Excel. I want to enter a european date 20/09/2004 and convert it into dd/mmm/yyyy what should display 20 Sep 2004 BUT it does not it stays like 20/09/2004. WHen I rewrite the date in 09/20/2004 and convert it does show 20 Sep 2004. The cell properties is set to english date and internation setting is also english. Why cant I enter european dates into excel.. Excel uses your Control Panel date settings to help determine what kind of an entry you are making. While 20/09/2004 is a valid date under many other countries' settings it is not with U.S. s...

performance of system.xml vs msxml4.0
I have an xsl file to generate xml in to an html file. The size of the xsl is 300kb and size of the xml is 47 kb (the size of xml is variable). I am using VB.net to convert the xml file into an html file. The vb.net module peforms following task: load the xml file in XMLDocument object ( I can't use XpathDocument object) load the xsl file in XSLTransform object perform the transformation. When I was using VB6 with Msxml 4.0 parser, I was getting good performance results. The transformation was completed in an average time of 40-50 milli second. When the same trasformation was perf...

Critical Path vs. Partially Complete Tasks
Hi MSP gurus, I found the following post in another forum (forums.cnet.com) - unfortunately without an answer. I guy named smagma asked: "Is there a way to force MS Project (2003) to calculate the Critical Path from Remaining Work instead of Total Work? If I have 5 tasks ordered by precedence, and one in the middle is 50% complete, the final delivery date should not include time of the completed portion. Similarly, is there a way to force all incomplete work to be automatically pushed to out to the future?" I think it's an interesting question since this issue w...

Importing fixed-width data
Dear all, I have a large number of huge text-files I want to import in Excel. Th data are in fixed-width format (each value is 5 characters long), bu there's no space or separator between them. That seems to be a proble for excel. The only way possible seems to be to 'draw' the column manually in the import wizard. I'd rather do it in an automatic way because of the large amount of data. Is there a simple solution to this problem? (I've got little excel an programming background.) Thanks a lot for any responses!! -- Message posted from http://www.ExcelForum.com Juliet...

Archive Sink Vs. Journaling
Hello, Which is a better option. I want to implement message logging and was confused as to which way is better in terms: -how comprehensive the message archiving is? -resources usage. Any help is appreciated. thanks. -st Both are not 100% perfect and have their Limitations. Why dont u use Aloaha. I offers you pop3, SINK, Journaling and SMTP Proxy. So you really cover all your needs. Uno "stonefly" <shitij_T@hotmail.com> schrieb im Newsbeitrag news:#jQA0ZD4EHA.3616@TK2MSFTNGP11.phx.gbl... > Hello, > Which is a better option. I want to implement messa...

exchange 2000 vs. 2003
Our company is considering upgrading from exchange 2000 to 2003. We are currently operating two remote and one main office. The exchange server is at the main office and the remote offices connect to the main office for exchange through a VPN managed by a Watchgaurd Firebox at the main office and two Watchgaurd SOHOs at the remote offices. We never have been very satisfied with this solution and the Watchgaurd product cause frequent headaches My question is this.... does Exchange 2003 combined with Server 2003 eliminate the need for needing the Watchguard's VPN boxes? Any comments ...

Import data from webservice
I've got a web service and I'm looking for a way for my users to easily consume those services in Excel. So..after scanning the Excel help and visiting MSDN I'm still stumped. How do you do it without having to write VBA code? Steven "Steven Doka" <stevendoka@comcast.net> wrote... >I've got a web service and I'm looking for a way for my users to >easily consume those services in Excel. So..after scanning the >Excel help and visiting MSDN I'm still stumped. How do you do it >without having to write VBA code? I believe you'd need...

importing mail from OE in one comp. to Outlook in another comp.
I know that I must export mail from OE to Outlook; however, how do I get the mail from OE in one computer to OE in the new computer You can't. Import it into OE first, then you can export to Outlook. -- Russ Valentine [MVP-Outlook] "Christian R Nash" <Christian R Nash@discussions.microsoft.com> wrote in message news:CA0F69AF-C0F7-43C6-A0BB-DFD9D1AA627A@microsoft.com... >I know that I must export mail from OE to Outlook; however, how do I get >the > mail from OE in one computer to OE in the new computer Thanks, I understand your response. But how do I get ...