CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2001
    Posts
    2

    user defined type

    Hi, I'm a C++ programmer trying to work my way with VB for the first time. I would be grateful if someone could help me out on this one: I'm trying to pass a user defined type variable as a parameter in a call to a method in a C++ server (COM):

    I get an error that sais that user defined types may not be passed ByVal, but the MSDN help sais that the default is byRef so can you please help me what I'm doing wrong:

    This is the code :



    Dim recipeParams as sADCRecipeParams
    recipeParams.bstrProductName = "TestProduct111"
    recipeParams.bstrLayerName = "Layer_A"
    recipeParams.bstrObjectiveName = "BF_20x"
    recipeParams.bstrRecipeName = "" 'no Recipe selected

    sdiAdcAgent.SelectRecipeForClassification _
    recipeParams, bstrLotID, bstrWaferID, _
    nSlotNum, nTestNum, lSize, _
    aBytes(0), nImageDimX, nImageDimY





    TIA,
    Avi


  2. #2
    Join Date
    Jun 2001
    Posts
    3

    Re: user defined type


    Make sure the put method has a [in, out] instead of a [in] and make sure the type is a *. It will not however conform to oleautomation attribute.

    In ATL IDL you will get a warning MIDL2039 : interface does not conform to [oleautomation] attribute : [ Parameter 'newVal' of Procedure 'put_someProperty' ( Interface 'IWhatever' ) ]



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured