Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

dolph_loe

@dolph_loe
About
Posts
20
Topics
13
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to load xml schema from resource?
    D dolph_loe

    Hi I want to include an xml validation schema as a part of an executable. My problem is how to add the schema to the MSXML2::XMLSchemaCache40. I have a schema called 'setup.xsd', and m_schemaCache is a MSXML2::IXMLDOMSchemaCollection2 interface to XMLSchemaCache40. The following code works ('setup' is the namespace for the schema). hr = m_schemaCache->add(L"setup", L"Setup.xsd"); Now I want to load the schema from a resource. Since IXMLDOMSchemaCollection2::add only accepts url's or MSXML2::DOMDocument's, I decided to parse the xml data using DOMDocument, and then pass the DOMDocument over to the XMLSchemaCache40. In the following code, everything seems to be ok until I try to add the DOMDocument to the XMLSchemaCache40. The resource is loaded, The DOMDocument parses it, and no errors are found. The readyState of the DOMDocument is 4. //Create resource name from resource id wchar_t sResName[10]; swprintf_s(sResName, 10, L"#%d", resourceId); //Locate the resource TCHAR sRestype[13] = _T("SCHEMA"); HRSRC hres = FindResource(NULL, sResName, sRestype); if (hres == 0) { return false; } //If resource is found a handle to the resource is returned //now just load the resource HGLOBAL hbytes = LoadResource(NULL, hres); // Lock the resource LPVOID pdata = LockResource(hbytes); //Convert the resource text file to data we can use LPBYTE sData = (LPBYTE)pdata; BSTR sXml = _bstr_t((char*) sData); //Crate instance of DOM parser MSXML2::IXMLDOMDocument* doc; hr = CoCreateInstance(__uuidof(MSXML2::DOMDocument), NULL, CLSCTX_ALL, __uuidof(MSXML2::IXMLDOMDocument), (void**) &doc); if (FAILED(hr)) return false; //We don't want async read doc->put_async(VARIANT_FALSE); doc->put_validateOnParse(VARIANT_TRUE); //Parse the xml schema we just loaded from our resources VARIANT_BOOL succeeded; hr = doc->loadXML(sXml, &succeeded); if (succeeded != VARIANT_TRUE) { //Load failed return false; } //HERE IT FAILS!!!!!! //Add the loaded schema to the schema collection hr = m_schemaCache->add(bstrNamespace, _variant_t(doc)); if ( FAILED(hr) ) return false; return true; What am I doing wrong? Thanks in advance for any answers :) øivind

    COM xml html database help tutorial

  • directshow sdk
    D dolph_loe

    I cant find the directshow sdk anywhere..! I downloaded the latest directx sdk, but it seems like it has been excluded from that package. Anybody who knows where I can get it? I am trying to access a webcam. Are there any other ways to do this? øivind

    C / C++ / MFC graphics game-dev question

  • ASP .NET vs PHP
    D dolph_loe

    I've been working with php for a while, but consider switching to asp.. Can anyone tell me what is asp's strong and weak sides compared to php? øivind

    ASP.NET question csharp php visual-studio

  • problem with long c++ file
    D dolph_loe

    I have some problems with a c++ file containing about 7000 lines. Sometimes, Visual Studio copies some of the last lines of the file, and prints them at the bottom of the file... only problem is that it doesn't show them in the editor.. I have to reopen the file to find and delete the 'new' code.. anyone having the same problem?? I am using Visual Studio .NET 2003.. øivind

    C / C++ / MFC csharp c++ visual-studio help question

  • Document template problem
    D dolph_loe

    tnx! had to add the following line

    pDocTemplate->m_bAutoDelete = true;

    :) øivind

    C / C++ / MFC question c++ help

  • Document template problem
    D dolph_loe

    HI! In my code, I create a document template in the following way:

    pDocTemplate = new CMultiDocTemplate(IDR_PHYSEDIT,
    RUNTIME_CLASS(CPhysEditDoc),
    RUNTIME_CLASS(CPhysEditFrame),
    RUNTIME_CLASS(CPhysEditView));
    if (!pDocTemplate)
    return FALSE;
    AddDocTemplate(pDocTemplate);

    Everything works perfectly, but when the program exits I get the following output: e:\work\c++\project\utilities.cpp(117) : {58} client block at 0x003F4B40, subtype c0, 140 bytes long. a CMultiDocTemplate object at $003F4B40, 140 bytes long {56} normal block at 0x003F49F8, 78 bytes long. Data: < 6 = = > D0 0D 36 10 3D 00 00 00 3D 00 00 00 01 00 00 00 My question is: How do I clean up the document template objects on exit? Shouldn't CWinApp do that? øivind

    C / C++ / MFC question c++ help

  • problem with dll
    D dolph_loe

    the class is like this: class _declspec(dllexport) jalla { std::list<int> m_mesh; }; øivind

    C / C++ / MFC question c++ help

  • problem with dll
    D dolph_loe

    In a dll, I define a class in the following way: class _declspec(dllexport) jalla { std::list m_mesh; }; but when I try to compile it, I get the warning: e:\Work\C++\Project\3DGame\3DSLoader.h(19) : warning C4251: 'jalla::m_mesh' : class 'std::list<_Ty>' needs to have dll-interface to be used by clients of class 'jalla' with [ _Ty=int ] what is happening? øivind

    C / C++ / MFC question c++ help

  • There is no source code available for the current location
    D dolph_loe

    still doesn't work... :sigh: any other ideas? ØIvIND

    C / C++ / MFC help tutorial question

  • global variables
    D dolph_loe

    makes sense :)

    C / C++ / MFC question

  • global variables
    D dolph_loe

    Ok.... dont know if i'm doing things the wrong way, but MSVC.NET gives me the message: The following breakpoint cannot be set: When 'g_resManager' changes Data breakpoints are not supported in the Common Language Runtime. I also tried to dereference g_resManager (which is a pointer) but that gave the same result.. :confused:

    C / C++ / MFC question

  • global variables
    D dolph_loe

    I have some global variables in my program, but some of them (pointers) suddenly change without me doing it.. How is this possible? øivind

    C / C++ / MFC question

  • There is no source code available for the current location
    D dolph_loe

    HI! When I'm debugging and stepping through my code, in certain places I get the message "There is no source code available for the current location.", even though it is my own code, and the files are in my project... Anyone know how to fix this? Øivind

    C / C++ / MFC help tutorial question

  • rotate blt ??
    D dolph_loe

    Is there any way to apply a rotation matrix to a CDC blt? I am trying to draw a rotated bitmap..

    C / C++ / MFC graphics question

  • how to display info about menu items in a dlg
    D dolph_loe

    When you use the appwiz to create a MDI or SDI app, info about each menu item is shown in the statusbar when you hover over the menu item. I have a dialog with a menu and a statusbar. Is there any good way to do this for me? Øivind

    C / C++ / MFC tutorial question

  • Setting the cursor
    D dolph_loe

    Weee! I got it right. I only needed to cast the cursor to (LONG_PTR) and not reference it: SetClassLongPtr(GetDlgItem(IDC_COLORDISPLAY)->GetSafeHwnd(), GCL_HCURSOR, (LONG_PTR) cursor);

    C / C++ / MFC question help

  • Setting the cursor
    D dolph_loe

    With your code, I don't get any warnings, but the cursor doesn't change.. =( SetClassLongPtr(GetDlgItem(IDC_COLORDISPLAY)->GetSafeHwnd(), GCL_HCURSOR, (LONG_PTR) &cursor);

    C / C++ / MFC question help

  • Suppress return and escape in a dlg
    D dolph_loe

    I am creating an app based on CDialog, but whenever I press escape or return, it exits. How do I stop this from happening?? Øivind

    C / C++ / MFC question

  • Setting the cursor
    D dolph_loe

    I use the following code to set the cursor of a window: HCURSOR cursor = theApp.LoadStandardCursor(IDC_ARROW); SetClassLongPtr(GetDlgItem(IDC_COLORDISPLAY)->GetSafeHwnd(), GCL_HCURSOR, (LONG) cursor); The problem is that I get the following compiler warning: warning C4311: 'type cast' : pointer truncation from 'HCURSOR' to 'LONG' How do I do this the right way?? Øivind

    C / C++ / MFC question help

  • uml in the IDE
    D dolph_loe

    I read an article about connectiong Visio and Visual Studio 6, so that visio automaticly reverse engineered your code and created a uml-diagram. I however, have Visual Studio .Net , and I don't know how to connect the two. In the article, they said something about a visio uml add-in, but I don't find it... HELP! =) Øivind

    Visual Studio csharp visual-studio help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups