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
M

morenz

@morenz
About
Posts
35
Topics
11
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • [VB2005] Transfer Data via NetBIOS with access credentials
    M morenz

    Hi folks, I must create a module in a project I'm in, that concerns of transferring data from one host to any given one, in a given protocol. For now, used protocols are FTP and NetBIOS (windows folder sharing). For FTP I'm OK, but I don't know if in NetBIOS there is a better way than mapping a drive via the console command "net use x: blah blah blah", that is not much failure-compliant (I don't know if remote host is up and ready). Hope it's clear. Thanks in advance Morenz

    Visual Basic

  • BSTR thru COM does not seem to be passed.....
    M morenz

    yes, I'm writing it in a file as a string. When I debug it, I see that the BSTR has the correct value, too... For now I workarounded it, making the client open the file directly on the server and getting the string itself, but it's not elegant...

    COM c++ com sysadmin help question

  • BSTR thru COM does not seem to be passed.....
    M morenz

    Hi everybody, I've got a strange thing using my DCOM application(s). I wrote both server and client, and one of the last issues I can't resolve is the following: On the server machine (EXE Server with MFC) I have the following class method (with implementation): STDMETHODIMP CAugVisionEngine::ReadText(BSTR CharSetName, int pTop, int pLeft, int pHeight, int pWidth, BSTR *OcrString) { AFX_MANAGE_STATE(AfxGetStaticModuleState()) ...[code omitted here for brevity] ... char* strTemp = (char*) malloc(sizeof(OcrReport_tmp->readString)+1); strcpy(strTemp, OcrReport_tmp->readString); *OcrString = W2BSTR(A2W(strTemp)); return S_OK; } where the last parameter, the BSTR, is the return value of the function (just [out], not [out, retval]) When I call the function from the client (for now MFC application, just to test, but the release will be a console application), in a way like this: BSTR OCRBSTR; pIVE->ReadText ("C:\\Patterns\\3260\\05042800\\1235.abc",40, 249, 48, 83, &OCRBSTR); I get that the server constructs the BSTR correctly (at least, it seems to do it, since a logfile is populated correctly), but my client retrieves nothing... I'm stuck... Any ideas? Thanks in advance, Morenz.

    COM c++ com sysadmin help question

  • Attach Method with SmartPointers causes problems marshaling UDTs?
    M morenz

    ok, no matter. The final decision will be taken by the customer, and it will be based on how SOON they want the project :laugh: In the worst case (custom marshaling) I think I will buy a book and, why not, consider to give a shot in some serious forum, like this...:-D Thanks for all. Enjoy Morenz P.S. Pardon me, but in your footnote (or signature) you have a typo: you should have "It's supposed to be hard" instead of "It's suppose to be hard":laugh:

    COM help com sysadmin sales beta-testing

  • Attach Method with SmartPointers causes problems marshaling UDTs?
    M morenz

    No, I verified several times... The server is registered also in client machine (with /RegServer switch), but it's configured (via DCOMCNFG) to go ONLY remote. To be sure, I referred for my test to some image files there were present only on server machine, and I referred them putting down the entire path when calling server methods. If it was like that you are saying, I should get a "file not found" error, instead it did all that it had to do with no problems at all. Also, if I unplug network cable, I get a "RPC Server Unavailable" error. Last question: if I decide not to use dual interfaces (therefore using IUnknown instead of IDispatch), can I get rid of this problem? If I decide doing custom marshaling where can I get an example of this technique (that I've never seen before?) Thanx again.... Morenz

    COM help com sysadmin sales beta-testing

  • Attach Method with SmartPointers causes problems marshaling UDTs?
    M morenz

    ok, I understood, you hit the correct point. I'm using dual interfaces (I noticed that using or not the oleautomation keyword does not affect things) and I'm using universal marshaling. One last thing: WHY does it work with CreateInstance? Just because CreateInstance uses the registery-based technique? How can it manage better these UDTs? Thanks again for your (your and Mil10's) precious help, that was not the first COM I created, but I was never gone so deep in COM architecture... Best regards, Morenz

    COM help com sysadmin sales beta-testing

  • Attach Method with SmartPointers causes problems marshaling UDTs?
    M morenz

    This is one of the UDTs I pass (both structures have been declared, in IDL file, with an UUID, I use SAFEARRAY with VT_RECORD and GetRecordInfoFromGuids on both server and client side): struct RGBValue_struct { unsigned int R, unsigned int G, unsigned int B, unsigned int alpha; }RGBValue; struct COM_IVA_Image_struct { SAFEARRAY(RGBValue) saPoints, int rows, int cols; }COM_IVA_IMAGE; the method declaration, in server side, is HRESULT loadImage([in] BSTR fileName, [out, retval] COM_IVA_Image IVAImage); and the call, on client side, is COM_IVA_Image IVAImage; IVisionEnginePtr pIVE; // that is my interface IVA_Image = pIVE->loadImage("2230.tif"); where am I wrong? thanx again Morenz

    COM help com sysadmin sales beta-testing

  • ATL Exe server..
    M morenz

    Hi, Did you make your interface visible to the client? Did you register the server? You may need a proxy-stub DLL, that is present on server side (but must be built and registered manually), and must be copied (the DLL only) and registered also on client side. Try it and make me know. Regards, Morenz.

    COM c++ sysadmin help

  • Attach Method with SmartPointers causes problems marshaling UDTs?
    M morenz

    Hi everybody, last (I hope) problem. After I released a beta of my preoject, 4 months ago, the customer asked me to change my COM-calling style. I used Smart Pointers with CreateInstance, and server registration on both sides. The customer does not want the server to be registered on client machine, so I was suggested to still use Smart Pointers, but now with CoCreateInstanceEx and Attach. Briefly, it was: ISwitchBoardPtr pISB; ... pISB.CreateInstance(__uuidof(SwitchBoard)); ... ...my code... ... pISB.Release now, it seems it has to be: ISwitchBoardPtr pISB; COSERVERINFO csi = {0, L"10.0.1.9", NULL, 0}; MULTI_QI qi = {&__uuidof(ISwitchBoard), NULL, S_OK}; HRESULT hr = CoCreateInstanceEx(__uuidof(SwitchBoard), NULL, CLSCTX_REMOTE_SERVER, &csi, 1, &qi); //error checking omitted ISwitchBoard *_pISB = static_cast(qi.pItf); pSB.Attach(_pISB); In this object I expose several UDTs, even big and complex (imagine a structure that has as one of its fields a SafeArray containing another structure), and when I used the first method, everything worked fine and the customer was happy, but when I started to use the second method, NONE of my UDTs is marshaled anymore. I get crashes in client (while the server keeps running fine, logically) when I try to get as [out] or [out, retval] parameters one of my UDTs. I'm stuck. The only thing I thought about is that qi.pItf is a IUnknown * type, while my objects expose IDispatch interfaces, but IDispatch is derived from IUnknown, as every interface in COM, so it should work, shouldn't it? Thanks for your kind help again...:)

    COM help com sysadmin sales beta-testing

  • GetRecordInfoFromGUID returns 0x80029C4A
    M morenz

    hi, thank you for the reply! (un)fortunately, it was my fault, because I have currently 2 versions of this project (the MFC and the Service ones), that are slightly different, and I used the wrong type library... Thanks again!

    COM help c++ com sysadmin announcement

  • GetRecordInfoFromGUID returns 0x80029C4A
    M morenz

    Hi folks, I'm developing a DCOM Client/Server project under Win2000 SP4 (both client and server) with VC++ 6.0. An object in this project has to interface with National Instruments Vision Builder 7, which DLLs are registered under \system32 folder (the package works with no problem) In this object, I have to pass an UDT that is a struct containing a safearray of another struct and two integer (that is, the safearray contains the RGB Values of all the points of my image and the two integers keep the image size). These structures are shown below. When I compile, I get MIDL warning 2368: Could not set UUID ... etc etc etc... but I've seen that this can be ignored with no problems. Now, when I run both client and server, I get an error when preparing to pack the safearray. In facts, I call GetRecordInfoFromGuids to build my SafeArray with VT_RECORD. Before, I was not doing error checking and everything seemed to be alright, but I got crashes. Now, that I added an if (FAILED(hr)) statement just after the call, I get a 0x80029C4A value, that is "Cannot load type library/DLL". Here's the structs: typedef [uuid(394143BC-4672-4E14-85DB-A96EBCA5A417), version(1.0), helpstring("RGB Representation of a single point")] struct RGBValue_struct { unsigned char B; //The blue value of the color. unsigned char G; //The green value of the color. unsigned char R; //The red value of the color. unsigned char alpha; //The alpha value of the color, which represents extra information about a color image, such as gamma correction. } RGBValue; typedef // {7F7037D8-C4D5-4b75-9C68-A9627EDE914B} [uuid(7F7037D8-C4D5-4b75-9C68-A9627EDE914B), version(1.0), helpstring("IVA_Data COM Wrapper")] struct COM_IVA_Data { SAFEARRAY(PointFloat) saPoints; int numPoints; int pointIndex; }COM_IVA_Data; Here's the function call : HRESULT Image2Variant (IVA_Image Source, COM_IVA_Image *Dest) { HRESULT hr = 0; // Initializing dimension descriptor for our SafeArray SAFEARRAYBOUND sabRGB[2]; sabRGB[0].lLbound = 0; sabRGB[0].cElements = Source.columns * Source.rows; hr = SafeArrayDestroy(Dest->saPoints); if (hr != 0) { sprintf(logMessage, "CAugVisionEngine - Image2Variant - SafeArrayDestroy Failed (%ld)",hr); WriteLogFile(logMessage); } Dest->saPoints = NULL; IRecordInfo *pUDTRecordInfo = NULL; hr = ::GetRecordInfoFromGuids(LIBID_AugSvrLib, 1,0,0,RGBValue_IID, &pUDTRecordInfo); if (FAILED(hr))

    COM help c++ com sysadmin announcement

  • DCOM and memory management: ???
    M morenz

    I got it. I was using malloc instead of CoTaskMemAlloc (and free instead of CoTaskMemFree) Now I'll change all of my statements (some hundreds!!!) and will try. Thanks a lot for now!!!

    COM sysadmin performance help question announcement

  • GetIDsOfNames returns E_ACCESSDENIED after installing SP2 on Windows XP Pro
    M morenz

    Hello, I've heard of troubles with XP SP2 and COM... probably they want us to migrate our projects into .NET framework... I saw that also a COM taht uses sinks to synchronize processes does not work correctly with XP SP2, while it does good with oter OSs of NT family. If I was you, I should check on MSDN if XP SP2 modifies behavior of GetIDsOfNames (usually they say it on function description...) Hope this helps Best regards Morenz.

    COM sharepoint question

  • DCOM and memory management: ???
    M morenz

    Hi again.... I finished my work, and I tested its modules one by one and they worked well. Now that I put them together, I went into a trouble: my server acts like a memory-consuming program... :) Let me explain.... I open Task Manager (on Win2000 Pro) on the server machine and, as I run the client, I see the memory growing up (both Memory Usage and VM Size) and page faults incrementing in hundreds per second. When I'm about at half of my test procedure, I see this Memory Usage: 22,680K Peak Memory Usage: 164,084K Page Faults: 512,718 VM Size: 508,640K Don't jump on your chair, these procedures work with images and send images as arrays, so it's normal to have huge structures on my wires... :) So I See that VM is not released, but I don't know why. It seems that function pointer is not well-released (because actual memory usage is normal, but VM no). I tried to AddRef and Release interface pointer in every function, instead of at hte beginning and at the end of the whole program, but it did not change a bit. What can be the problem? Thanks in advance, Morenz.

    COM sysadmin performance help question announcement

  • SafeArrayCreate(Ex) Failure....
    M morenz

    First of all, thanx a lot for your reply. I did it work, it was none of the precedent thoughts or ideas we had. It was simply that the cElements record of SAFEARAYBOUND structure had a too big value. I tried with 1000, and it's too big again. It likes 10 ;). Now, if that's the problem, I'm back again at the starting point. I need to pass an array that could be max 1024 rows x 1024 cols, x 4 bytes (almost 4 megabytes). How can I do? Putting it into a file, sending the file and reading it back again serially is not a good trick, because if it's true that time is not a prerequisite, it's true, too, that I cannot make it last a minute to analyze a 1024 x 1024 raster image! Should I serialize it into strings and send 'em in some chunks? How can I do? When will these annoying problems stop, so I can start making a decent debug? :mad: Thanks again Morenz

    COM com data-structures question workspace

  • SafeArrayCreate(Ex) Failure....
    M morenz

    Hi Folks ;) I finished burning my brain with system-level configuration of my com, and now I get the first "normal" errors. I have a Variant that contains an array of a structure (4 int), and 2 other int, that are rows and columns (of the image I must import) In this piece of code HRESULT Image2Variant (IVA_Image Source, VARIANT *Dest) { SAFEARRAYBOUND sabRGB[6] sabRGB[0].lLBound = 0; sabRGB[0].cElements = Source.columns * Source.rows; sabRGB[1].lLBound = 0; sabRGB[1].cElements = Source.columns * Source.rows; sabRGB[2].lLBound = 0; sabRGB[2].cElements = Source.columns * Source.rows; sabRGB[3].lLBound = 0; sabRGB[3].cElements = Source.columns * Source.rows; sabRGB[4].lLBound = 0; sabRGB[4].cElements = 1 // the only columns value sabRGB[5].lLBound = 0; sabRGB[5].cElements = 1 // the only rows value VariantInit(Dest); Dest->vt = VT_VARIANT | VT_ARRAY; Dest->parray = SafeArrayCreate(Dest->vt, 1, saRGB); .... Dest->parray is NULL, so I think that function fails, but I don't know why... Suggestions? Thanx Morenz

    COM com data-structures question workspace

  • Strange, even stranger errors with my DCOM... (Long MSG)
    M morenz

    As soon as I got a Win2k machine, I noticed that i couldn't register ONE out of my FOUR classes. I went in my source code, and I noticed that when I tried to modify project for custom marshaling, I commented out the COM_INTERFACE_ENTRY(IDispatch) for two interfaces, and the third I modified it into COM_INTERFACE_ENTRY (IUnknown). The ONLY class that was right, was the only one that could not be registered. Fixing it, on a 2k machine registers and starts regurlary. Now, it's to try on a XP machine... but I think it will work.... Yesterday was a bad day, you know, I made so many bad things.... Today is a good day, many problems getting away... ;)

    COM help sysadmin performance question

  • help for COM ebooks
    M morenz

    Hi, I searched some months ago for ebooks on the web, but I just found the COM Specification on Microsoft Web Site. I purchased a book that has been a bible for me, Don Box's "Essential Com". That's all, I'm sorry Morenz

    COM com help

  • Strange, even stranger errors with my DCOM... (Long MSG)
    M morenz

    Hi folks... it's me again.... :(( Now approaching wit another strange problem. I just upgraded my systems to Platform SDK Feb '03 to permit me to declare UUIDs in structs in IDL files. I finished redesigning all the project, put the structs in right places, made the appropriate modifies, then I compiled the server and that went OK, compiled the proxy/stub DLL and that was OK again, compiled the client and it went OK. After that I picked up the server executable and the DLL and copied in my folder on client side, and tried to register both of them. The DLL was OK, but not the client. I got a MessageBox that told me of a memory leak, but the title of that MessageBox left me breathless. (LWTCPJSOCKWNDYCLASS: STTRServer.exe - Application Error). I tried to search about that string but don't know what it is. I just can guess that is something about the network, but just nothing more. So I fulfilled the registration part with log statements and I saw that the program executes ALL the instructions (and the return code is ALWAYS S_OK!). So I was stuck. Just to try, I saw that the component registered however, so I tried to start it. Well, it does some strange things. 1) It executes on both client and server (when I configured it to run ONLY on remote machine) and fills BOTH logs:doh: 2) It gives me an error 0x80029c4a: cannot load library/DLL.:doh::doh: The only thing I've not yet done is to rebuild the project on client (since it's an XP Pro machine, while the server is a 2000 Pro machine), but it should work anyway, not event vice versa, but an older engine should work on a newer OS, not? Is there someone that can help me? I can send (not post due of size) code to anyone that would like to analyze it. Thanks again (and I hope this would be the last, for this project! I'm getting crazy!:mad:) Morenz

    COM help sysadmin performance question

  • How to put a struct into a VARIANT?
    M morenz

    Because my structs contain, in some cases, arrays, that have to be defined as SAFEARRAYS. In any case, I implemented this way... I will debug the application when I will resolve my new problems (It's since a month that, when I manage to resolve a strange problem, there comes in another problem, even stranger, if possible! :sigh:) If you're curious, look above.... :) Thanks again, Morenz

    COM question sysadmin sales 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