Re: [xml] Help Required



Hi All,

Ok, I have started with a clean app and I can access the functions
without any problems. The following was done to achieve this:

1. Tools->Options->Directories Tag, 
        Include files:
                Added directory c:\projects\tutorial_1\thirdparty\inlude
        Library files:
                Added directory c:\projects\tutorial_1\thirdparty\lib
2. Copied the DLL files to directory where the .exe resides in this case
        C:\projects\quote\win32\CleanAppXML\Debug
3. Project->Settings-->link Tab
        Added files libxml2.lib zlib.lib iconv.lib

Added the source code to read xml document provided by tutorial on
libxml website(cannot remember URL now). Add voila!!, it's working. 

I would still like to know why the DLL is required to be in the same
directory as the .exe? Can someone explain this. 

On a last note, thanks to everyone who replied and prevented me from
going nuts!!!, ;-).

Now, I will delve further into all the functions to get a good
understanding of how all the libxml functions work. 

Enjoy

Regards

Xen
Johannesburg, S.A. 

-----Original Message-----
From: Xen Cloete 
Sent: 02 March 2007 09:23
To: 'Coleman Brumley'
Cc: Tim Van Holder; xml gnome org
Subject: RE: [xml] Help Required

Thanks Coleman for explaining what is happening in the background with
the DLL and lib file. I wasn't aware that both lib and dll file is
created at the same time. I will place the dll file in the same
directory as the application exe file. 

So to sum up, I must load the libraries in the Object/library modules
section and call the functions normally. I will certainly give this a
try and see if I am successful at it.

What is the reason then for having the DLL available when running the
application? Surely all you need is just the lib to do the function
calls?

Just to explain what we currently do:

We have a DLL that is used by third party vendors to provide information
on quotes. The DLL is written so that it is platform independent. Now
source of the application uses libxml2.lib, zlib.lib and iconv.lib to
read xml files and to return information using xml with the resultant
data. 

We compile the source code which ends up as a DLL which then is
distributed to the various third parties. My question is then; when
running your own application using the Quoter.dll why are we not using
the DLL's for the lib files mention above? How does this work in the
background?


Much appreciated. Thanks again

Best Regards

Xen 

-----Original Message-----
From: Coleman Brumley [mailto:coleman brumley comcast net] 
Sent: 01 March 2007 04:17
To: Xen Cloete
Cc: Tim Van Holder; xml gnome org
Subject: Re: [xml] Help Required



Xen Cloete wrote:
I assume you mean Visual C++ 6.0, not one of the newer .NET ones.
    
Yip that's correct. VC++ 6.00. 

  
Forgive me for asking the obvious: did you add libxml2.lib to the
"Object/library modules" field of the Link tab of the Project
Settings
dialog?
    
Yip it certainly has been added. See my setting with the reply to
GORKA.
  
No, it isn't.  Below is your setting copied from your other posting.  I 
snipped the irrelevant stuff. libxml2.lib isn't there.

Link Tab:
Object/library modules:
Ws2_32.lib 
kernel32.lib 
user32.lib 
gdi32.lib 
winspool.lib 
comdlg32.lib 
advapi32.lib 
shell32.lib 
ole32.lib 
oleaut32.lib
uuid.lib 
odbc32.lib 
odbccp32.lib 

My understanding of the .lib files is that these files are not the same
as .dll files. To read .dll files you would obviously use the
LoadLibrary and GetProc... functions to load into memory and then
access
these functions. 


That's not true. When something is compiled a a DLL, it also produces a 
lib file. That lib file can be included in your linker setting, and 
there is no need to do LoadLibrary and GetProc jazz. Just call the 
functions as you normally would. Make sure the .DLL file is somewhere 
the .exe can find it though. You CAN use LoadLibrary, etc. You just 
don't HAVE to.

Static lib files are different from .DLL files.  You just link with the 
.lib file at compile time.  You don't need LoadLibrary, etc. in this 
case either.  Just call the functions. 
  
The "resource file section" sounds like the wrong place to add a
library. Similarly, the location of libxml2's headers should be in
the
"Additional include directories" field of the Preprocessor section of
the C/C++ tab, not the "Additional resource include directories"
field
of the Resources tab.
    

You are probably correct. However let me throw a spanner in the works.
I
have the production application setup this way. This was done by
previous C/C++ developer. And this works. I have setup everything the
same as the production applications settings. But no luck!!
  
This is certainly not the normal way of linking with a library at 
compile time. 



"Hollard is a licensed Financial Services Provider (FSP) as defined in the Financial Advisory and 
Intermediary Services Act (FAIS). FAIS requires that anyone who makes any recommendation, guidance or 
proposal of a financial nature must be a duly authorised representative of a licensed FSP. If you are seeking 
financial advice, or if you feel that this email constitutes financial advice, or if the author of this email 
wants you to purchase, amend or cancel a policy, please check with the author that he/she is a registered 
representative of Hollard." 
This email and all content are subject to the following disclaimer:

"http://www.hollard.co.za/legal/disclaimer.htm"; 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]