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
C

Carsten Leue

@Carsten Leue
About
Posts
12
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • CreateMetaFile on Win7 64bit
    C Carsten Leue

    Hi Dave, but why would "CreateCompatibleDC" return "File already exists"? The method "CreateMetaFile", that actually creates the file, completes successfully. I understand that CreateEnhMetaFile exists, but need to be able to create WMF file legacy reasons. Regards Carsten

    Windows API graphics performance help question

  • CreateMetaFile on Win7 64bit
    C Carsten Leue

    I have test code that embeds a bitmap in a WMF metafile and creates a memory DC for that purpose. The code works fine on XP but fails on Windows7 64bit. The minimum sniplet to recreate the problem is:

    HDC hDC = ::CreateMetaFile(\_T("test.wmf"));
    HDC memDC = ::CreateCompatibleDC(hDC);
    \_ASSERTE(memDC != NULL);
    
    ::DeleteDC(memDC);
    
    HMETAFILE hMeta = ::CloseMetaFile(hDC);
    
    ::DeleteMetaFile(hMeta);
    

    CreateCompatibleDC fails and GetLastError returns 183. Is the creation of WMF files no longer supported on Windows7? The corresponding CreateEnhMetaFile method works fine. Thanks Carsten

    Windows API graphics performance help question

  • while (*p++);
    C Carsten Leue

    It's a bummer! You are correct. The loop ends if p points to the end of the string but p is still incremented. Carsten

    C / C++ / MFC

  • while (*p++);
    C Carsten Leue

    If p initially points to a character string then after while(*p++); p points to the 0 character that terminates the string. So it is semantically the same as p = p + _tcslen(p);

    C / C++ / MFC

  • IImageDecodeEventSink
    C Carsten Leue

    Does anybody know where I can find information on the IImageDecodeEventSink and the IImageDecodeFilter interfaces that are declared in ocmm.h? Best regards Carsten

    C / C++ / MFC question

  • SOAP via stdin/stdout - how?
    C Carsten Leue

    I would like to make a soap call that should work the following way: For every method invocation 1. the client starts the server executable 2. the client pipes the input message to stdin of the server process 3. the server reads stdin, decodes the soap message and processes it 4. the output message is written to stdout by the server 5. the client decodes the message and continues Ideally it would be possible to define a SOAP binding in the WSDL that define the executable to be started instead of specifying a URL. Is there something like a predefined EXE-binding in WSDL? Are there SOAP frameworks that allow you to pipe SOAP via stdin/stdout instead of making a http request? Best regards Carsten

    XML / XSL wcf wpf sysadmin xml question

  • Which COM interface to export an object into a particular format
    C Carsten Leue

    Hi Vita. I guess I want to make a different point. The COM object that I have represents a graphic with an internal binary representation that is specifc to my application. I want to export this graphic to JPEG into a stream (or a number of other formats). The JPEG representation is not enough to recreate my graphics, so it is not equivalent to persisting my object, I just want to export it to a stream (not to a file), e.g. to pipe it into another filter stream or to return it as a response to an http request. Somewhat like this (pseudocode): IUnknown* pMyObject = ... IStream* pOut = ... // E.g. via SHCreateStreamOnFile(...) IExport* pExport; pMyObject->QueryInterface(IID_IExport, (LPVOID*) &pExport); LPCWSTR mimeType = L"image/jpeg"; IBindCtx* pJpegOptions = ... IPersistStream* pPersStream; pExport->get_Persister(&pPersStream, mimeType, pJpegOptions); pPersStream->Save(pOut, FALSE); // export the same instance into a different format mimeType = L"application/postscript"; IBindCtx* pPostscriptOptions = ... pExport->get_Persister(&pPersStream, mimeType, pPostscriptOptions ); pPersStream->Save(pOut, FALSE); I wonder if this is the right programming pattern to export an object and if yes, is there a standard interface that corresponds to the IExport in my pseudocode? I considered using IPersistMoniker like this: IUnknown* pMyObject = ... IPersistMoniker* pPersMon; pMyObject->QueryInterface(IID_IPersistMoniker, (LPVOID*) &pPersMon); IMoniker* pOutMon; CreateFileMoniker(L"test.jpg", &pOutMon); IBindCtx* pJpegOptions = ... pPersMon->Save(pOutMon, pJpegOptions, FALSE) Is this the right pattern?

    COM com tutorial question

  • Which COM interface to export an object into a particular format
    C Carsten Leue

    [Message Deleted]

    COM com tutorial question

  • Which COM interface to export an object into a particular format
    C Carsten Leue

    Hi Vita. Right, but how does the interface allow me to export my object? I would guess the correct format by evaluating the file extension, but that won't work if want to stream the content instead of writing it to a file (IPersistStream). Also IPersistFile does not allow me to pass extra information to configure the export process, such as target width/height of an exported bitmap or the compression ratio for JPEG.

    COM com tutorial question

  • Accessing COM componenets from Java
    C Carsten Leue

    The eclipse project has COM support built in, so you could look at using these eclipse libraries. Then there is the Java-to-XPCOM Bridge project (XPCOM are essentially COM interfaces independent of the win32 headers) http://www.mozilla.org/projects/blackwood/connect/ And IBM has bridge2java which worked fine for me http://www.alphaworks.ibm.com/tech/bridge2java Best regards Carsten

    COM java com help question

  • suggest a good book for COM
    C Carsten Leue

    Don Box' books are definitely the best in my opinion. Essential COM http://www.amazon.com/gp/product/0201634465/104-1873800-1887156?v=glance&n=283155&n=507846&s=books&v=glance Effective COM http://www.amazon.com/gp/product/0201379686/104-1873800-1887156?v=glance&n=283155&n=507846&s=books&v=glance Carsten

    COM c++ com oop learning

  • Which COM interface to export an object into a particular format
    C Carsten Leue

    I would like my COM object to expose the functionality to export itself into different binary representations into an output stream. E.g. to render itself into a stream as PDF or as JPEG, etc. The functionality itself is already available, but I don't know how to expose this function in terms of standard COM interfaces. I looked at the IPersistXXX interfaces but they don't allow to specify the target format but assume that the format is inherent to the object. Also for every output format there are potentially format dependent options that need to be passed in. IPersistMoniker looked promising but I am not sure if the intent of this interface is the export into different formats. I would like to reuse existing COM interfaces if possible rather than defining my own interface. What do you recommend? Best regards Carsten

    COM com tutorial question
  • Login

  • Don't have an account? Register

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