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

David_Leikis

@David_Leikis
About
Posts
11
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Registering Proxy/stub DLL
    D David_Leikis

    After a few phone calls to Microsoft support, I got the answer to the problem of the Proxy/Stub not working and seeming to need to be registered with DevStudio. It seems that the Regsvr32 utility needs to have the COM object already installed BEFORE you install the PS!!! The bottom line is that the PS.DLL MUST be registered last! If you don't, there will never be any notification of error or warning, the COM object will fall back to standard marshalling and your custom marshalling PS.DLL will simply not be invoked. I just had my client register the PS.DLL again (last) and it worked immediately. -- modified at 9:00 Tuesday 11th October, 2005

    COM question c++ com sysadmin windows-admin

  • SafeArrayCreate(Ex) Failure....
    D David_Leikis

    A suggestion for you on your SafeArray init. I believe that you need to init the vt (first param) with a data type, that is, VT_R4 or something such as that. I am not certain if you are putting in Array addresses in the safearray itself. It looks like you want data values such as floats or integers. I have used several safearrays and my inits always work with a VT_R4 for float instead of your Dest->vt. The documentation states: >> vt The base type of the array (the VARTYPE of each element of the array). The VARTYPE is restricted to a subset of the variant types. Neither the VT_ARRAY nor the VT_BYREF flag can be set. VT_EMPTY and VT_NULL are not valid base types for the array. All other types are legal. >> The other suggestion is that this array is for two dimensions ((Source.columns * Source.rows) by 6), is it not? Therefore the second parameter of the SafeArrayCreate should be 2.

    COM com data-structures question workspace

  • Registering Proxy/stub DLL
    D David_Leikis

    I have created a marshaling proxy/stub DLL to handle the custom data interfacing of a COM object. The COM is a .exe and I am having trouble getting the marshaller to work during deploy. If I install the C++ application and COM server on a target machine and register the components this way... (COM server is SPDCom) c:\TARGETFOLDER\SPDCom.exe /Regserver regsvr32 c:\TARGETFOLDER\SPDComPS.dll The COM object is started and running in memory properly by the application, but I do not get any data from the Proxy/Stub. (Just the first data item in the passed arrays.) I was only able to get the project to work well after using VC++ 6.0 to build and register the SPDComPS project on the target machine. Before I built and registered the PS project, I did verify that the PS was registered in the registry with all of it's GUIDs. Finally, with this background, my question is: What is the difference between registering using regsvr32 from the 'RUN' prompt and from within VC++? (That seems to be the only difference!) David Leikis ATK Thiokol Propulsion

    COM question c++ com sysadmin windows-admin

  • Marshalling problem
    D David_Leikis

    Thanks for your answers Bio. I am using VC++6.0 so I have to build it manually. I have tried to run the nmake command from a command prompt at the top of the project .cpp file... // Note: Proxy/Stub Information // To build a separate proxy/stub DLL, // run nmake -f SPDComps.mk in the project directory. This is the error that I got. fatal error C1189: You need a Windows2000 or later to run this stub because it uses the following features: NMAKE: error U1077: 'cl' return code '0x2'. Stop. Lim Bio Liong wrote: If you are using VC++ 6.0, you would need to build the proxy/stub project and dll manually. I can also use SAFEARRAY's but I didn't have much better luck using them. I didn't seem to get anything back then. I may try that also. Maybe I have learned something more in the last few days of trying this...:) David

    COM com sysadmin data-structures help question

  • Marshalling problem
    D David_Leikis

    I tried to do that from a command prompt window, but got an error: fatal error C1189: You need a Windows2000 or later to run this stub because it uses the following features: NMAKE: error U1077: 'cl' return code '0x2'. Stop. Any ideas? David

    COM com sysadmin data-structures help question

  • Marshalling problem
    D David_Leikis

    The array contains the x and y coordinates of each of the nodes that have been found and therefore is two times the number of nodes. They are just packed in sequential pairs. BTW, this method that I am trying to get going is from a text "Com+ Programming" by Pradeep Tapadiya. It just seems as though this might work if I have the proper settings??? I have seen it on MSDN and other postings as well. Do you understand what Vita was talking about with a Proxy/Stub DLL and why wouldn't the TypeLib marshaller understand the size_is ? Thanks, David

    COM com sysadmin data-structures help question

  • Marshalling problem
    D David_Leikis

    Yes, my code is very similar to your example. 1. I have verified that the value for pNum_ROI_nodes is positive and the correct value for the situation. 2. I have seen that all of the values do get loaded into the memory assigned for the array on the server side in the server's memory space. 3. Upon return to the client side, I can see that the value returned for the pNum_ROI_nodes is still the correct value and is in the client memory space, but upon trying to read the values with: for (int i = 0; i < pNum_ROI_nodes * 2; i++) { pfCoordValue[i] = (float)pROI_coords[i]; //retrieve the values to local array } CoTaskMemFree(pROI_coords); //delete the array created within the COM server object At this point, the only value that is in the array pROI_coords, is the very first value loaded. In your example, it would be the value of 1.0. All other values are none existent and it is clear from the memory contents that the array is not initialized past one value. It appears that the marshaller is only moving one item of the array to the client side. Vita has suggested that the marshaller does not understand the size_is command, maybe he is on to something... Regards, David

    COM com sysadmin data-structures help question

  • Marshalling problem
    D David_Leikis

    Thank you for your posting, but I need some more info on how to do what you suggested. Could you tell me some steps on how to do this and how is it different than what I have already done? I don't know the difference. Regards, David

    COM com sysadmin data-structures help question

  • Marshalling problem
    D David_Leikis

    I am trying to get an array created in a COM Server and passed back to the client by the mechanism: [out, size_is(,*pNum_ROI_nodes)] float **pROI_coords from the .idl file. Where the pNum_ROI_nodes is the size of the array and pROI_coords is the name of the array. Problem: I am receiving only one value back in this array on the client side. I have verified that only one value is being allocated in the array by the marshaller in the client side. All data is being loaded into the server side of this array (where it is being created by (float*) CoTaskMemAlloc((resultNodes * 2) * sizeof(float))) The data on the client side is the very first value loaded into it by the server and nothing else except 0x0d f0 ad ba in the second location. (bad food) Is there some setting for the COM that is confusing the marshaller? The above [out, size_is(,*pNum_ROI_nodes)] float **pROI_coords is only in the *.idl file. Should it be somewhere else as well?? The marshaller just doesn't seem to be getting the idea that there is an array, rather a single value. Thanks in advance, David

    COM com sysadmin data-structures help question

  • Menu messaging
    D David_Leikis

    I have an application written in VC++6 that has been working great for some time, but I recently added a menu bar item with two submenu selections to respective message handlers. It works well on my machine and any others in my group that have VC++ installed, but doesn't show any response, error or change if these new sub-menu items are selected on any other machine. Our plant just changed over to XP at the same time, (so the water is now muddy!) but we can't find any hard correlation except that the custom menu selections (previously added in other versions) that used to work with the old workstations under Win98 are now giving a message "Attempted an unsupported operation!" Does anyone have any suggestions? I will add some prompts to see if I even get into the message handler, but I don't think that it does! David Leikis ATK Thiokol Propulsion Laboratory Automation

    C / C++ / MFC c++ testing tools help question

  • HWND to a UIThread
    D David_Leikis

    I am trying to create a thread to monitor a USB-connected ADC module. Its driver uses a callback function for the configuration of the module. It requires a CWnd handle given to it such that when it has a buffer filled, it sends a OLDA_WM_BUFFER_DONE message to the thread. I created a UIThread so that it would have a message handler and I could create my OnBufferDone function. (Which is working and tested in a single thread situation.) It needs to be in a separate thread so that I can empty the buffer quickly and move the sample data into my internal buffers and return it back to the ADC module driver before the next buffer_full message comes in. Does anyone know how to create or get a HWND for a UIThread so that this driver can know where to send messages to my thread? Thanks in advance, Dave :((

    C / C++ / MFC tutorial question workspace
  • Login

  • Don't have an account? Register

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