MSXML



  • Hallo Allerseits

    Folgendes Problem: Ich muss eine XML Datei auseinanderpflücken (verschiedene werte aus der Datei in variablen speichern). In der Datei sollen definierte Settings gespeichert werden...

    Nun hab ich mich für MSXML entschieden, was es gratis downzuloaden gibt...

    Und hier ligt das Problem: Wie binde ich nun die DLL ein? MSDN und das "FAQ WinAPI" meinen in etwas folgendes:

    #import "msxml4.dll"
    using namespace MSXML2;
    

    Also hab' ich msxml4.dll in den Projektordner kopiert und einfach mal folgendes Probiert:

    #include <tchar.h>
    #include <windows.h>
    #include <iostream.h>
    #include <stdio.h>
    #include <conio.h>
    #include <winbase.h>
    
    #import "msxml4.dll"
    using namespace MSXML2;
    
    using namespace std;
    
    int main(int argc, char *argv[]) {
      /*HINSTANCE hLib=LoadLibrary("msxml4.dll");
      if(hLib==NULL) {
        cout << "Unable to load library!" << endl;
        getch();
        return EXIT_SUCCESS;
      }
      else {
        cout << "Library loaded!" << endl;
      }*/
      getch();
      return EXIT_SUCCESS;
    }
    

    Dev-C++ meint dazu fas hier:

    Compiler: Default compiler
    Building Makefile: "E:\ipa\C++\xmltest\Makefile.win"
    Executing  make clean
    rm -f main.o  xmltest.exe
    
    g++.exe -c main.cpp -o main.o -I"lib/gcc/mingw32/3.4.2/include"  -I"include/c++/3.4.2/backward"  -I"include/c++/3.4.2/mingw32"  -I"include/c++/3.4.2"  -I"include"   
    
    In file included from C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/backward/iostream.h:31,
                     from main.cpp:3:
    C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
    In file included from main.cpp:8:
    
    msxml4.dll:1: error: stray '\144' in program
    In file included from main.cpp:8:
    msxml4.dll:1:4: warning: null character(s) ignored
    msxml4.dll:1: error: stray '\3' in program
    msxml4.dll:1:6: warning: null character(s) ignored
    msxml4.dll:1: error: stray '\4' in program
    msxml4.dll:1:10: warning: null character(s) ignored
    msxml4.dll:1: error: stray '\255' in program
    
    msxml4.dll:1: error: stray '\255' in program
    msxml4.dll:1:15: warning: null character(s) ignored
    msxml4.dll:1: error: stray '\184' in program
    msxml4.dll:1:18: warning: null character(s) ignored
    msxml4.dll:1:26: warning: null character(s) ignored
    msxml4.dll:1: error: stray '@' in program
    msxml4.dll:1: error: stray '\248' in program
    msxml4.dll:1:62: warning: null character(s) ignored
    msxml4.dll:1: error: stray '\14' in program
    msxml4.dll:1: error: stray '\31' in program
    msxml4.dll:1: error: stray '\186' in program
    msxml4.dll:1: error: stray '\14' in program
    msxml4.dll:1:69: warning: null character(s) ignored
    msxml4.dll:1: error: stray '\180' in program
    msxml4.dll:1: error: stray '\205' in program
    msxml4.dll:1: error: expected constructor, destructor, or type conversion before '!' token
    msxml4.dll:1: error: expected `,' or `;' before '!' token
    msxml4.dll:1: error: stray '\184' in program
    msxml4.dll:1: error: stray '\1' in program
    
    msxml4.dll:1: error: stray '\205' in program
    msxml4.dll:3:2: warning: null character(s) ignored
    msxml4.dll:3: error: stray '\169' in program
    
    msxml4.dll:3: error: stray '\249' in program
    msxml4.dll:3: error: stray '\167' in program
    msxml4.dll:3: error: stray '\200' in program
    msxml4.dll:3: error: stray '\151' in program
    msxml4.dll:3: error: stray '\244' in program
    msxml4.dll:3: error: stray '\200' in program
    msxml4.dll:3: error: stray '\151' in program
    msxml4.dll:3: error: stray '\244' in program
    
    msxml4.dll:3: error: stray '\200' in program
    msxml4.dll:3: error: stray '\151' in program
    msxml4.dll:3: error: stray '\244' in program
    msxml4.dll:3: error: stray '\249' in program
    msxml4.dll:3: error: stray '\192' in program
    msxml4.dll:3: error: stray '\202' in program
    msxml4.dll:3: error: stray '\244' in program
    msxml4.dll:3: error: expected declaration before '}' token
    
    make.exe: *** [main.o] Error 1
    
    Execution terminated
    

    Hat damit jemand Erfahrung?

    Gruss und Kuss 😉
    Der Gast



  • Der Gast schrieb:

    Und hier ligt das Problem: Wie binde ich nun die DLL ein? MSDN und das "FAQ WinAPI" meinen in etwas folgendes:

    primär mal gar nicht. du bräuchtest dazu eine bibilothek (*.lib oder *.a)
    oder du lädst die dll dynmisch mittels
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/loadlibrary.asp
    und
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getprocaddress.asp

    Der Gast schrieb:

    #import "msxml4.dll"
    

    wo hast diese direktive her?

    zu deinem code.
    iostream.h und stdio.h sind veraltet
    http://fara.cs.uni-potsdam.de/~kaufmann/?page=GenCppFaqs&faq=iostream#Answ


Anmelden zum Antworten