Microsoft Visual C++/VC++ >> Tom, what server are you posting to ?

by ?UTF-8?Q?JeffE280A6Relf » Wed, 27 Jun 2007 12:43:01 GMT

What server are you ( Tom ) posting to ?
It's not " News.MicroSoft.COM:119 ", I'm sure.


Microsoft Visual C++/VC++ >> Tom, what server are you posting to ?

by Tom Serface » Wed, 27 Jun 2007 22:39:00 GMT


According to my settings it msnews.microsoft.com and the port is NNTP:119.
Not sure why that matters though. My messages seem to show up here :o)

Tom

Similar Threads

1. Please read this post.C++ COM Server C# client Interoperability problem

Hi, Please ignore the last two previous posts today. All of a sudden
the posts were submitted even though I didn't hit the post button.
     We built a Visual Studio 2005 C++ COM dll in process
server(universal  marshaler,Apartment threaded) . When we use a
unmanaged C++ client  with this dll, we can successfully call the COM
methods. The IDL and C++ client code are shown below.
      The problem occurs when we register this COM DLL, build a
Visual
Studio 2005 C# Client with a COM reference to this dll,

using System;
using System.Collections.Generic;
using System.Text;


namespace CReadWriteClient
{
    class CReadWriteClient
    {
        static int Main(string[] args)
        {


            string dLICENSE = "LL58JH2Y";


            mdMATCHUPOBJECTLib.mdMUReadWriteClass ReadWrite = new
mdMATCHUPOBJECTLib.mdMUReadWriteClass();


            ReadWrite.SetLicenseString(dLICENSE);
        }
   }
}

When we try to invoke the line ReadWrite.SetLicenseString(dLICENSE) ,
we get the exception:
Unable to cast COM object of type
mdMUMATCHUPOBJECTLib.mdMUReadWriteClass to interface
mdMATCHUPOBJECTLib.ImdMUReadWrite. The operation failed because the
QueryInterface on the COM Component for the interface
{F5AF53C-9076-4E2B-9B5B-1ACF12AFC13E} failed due to the following
error Bad Variable Type (hResult) = 0x8002008 DISP_E_BADVARTYPE.
   We are beginning to think that this is a C# Interoperability
Runtime Callable Wrapper problem because the C++ COM client works OK.
There are several unique things about IDL. There is one type library
containing the COM classes corresponding to 3 separate dual interface.
Also, in several IDL methods, we have interface arguments. For
example , the following method in the ImdMUReadWrite  interface has an
ImdMUMatchcode interface.

           [propput, id(3), helpstring("property MatchcodeObject")]
HRESULT
                                 MatchcodeObject([in] ImdMUMatchcode
*Matchcode);

Could the IDL interface have anything to do with our RCW problems? Is
there any way we can debug the C# RCW(s)(i.e. conceptually there is
one RCW for each interface) . We already tried ildasm.exe.
      Finally, we defined _ATL_DEBUG_QI, so we could trace the query
interface functions in atlcom.h but when the DISP_E_BADVARTYPE
exception is thrown we get no debug messages printed in the DebugView
tool. We would like to know why this exception is being thrown . Thank
you for being so patient with all the retries on this post.

---------------------------------------------------------------------------?---------------------------------------------------------------
// mdNameObj.idl : IDL source for mdNameObj
//


// This file will be processed by the MIDL tool to
// produce the type library (NameObj2.tlb) and marshalling code.


import "oaidl.idl";
import "ocidl.idl";


                [
        object,
        uuid(B644DB6F-047B-4455-92C8-167A10D4FD17),
        dual,
        helpstring("ImdMUMatchcodeComponent Interface")
                ]
interface ImdMUMatchcodeComponent : IDispatch {
        [propput, id(1), helpstring("property ComponentType")]
HRESULT
ComponentType([in] MatchcodeComponentType Type);
                [propget, id(1), helpstring("property
ComponentType")]
HRESULT
ComponentType([out,retval] MatchcodeComponentType *RetVal);
                [propput, id(2), helpstring("property Size")] HRESULT
Size([in] int
Size);
                [propget, id(2), helpstring("property Size")] HRESULT
Size([out,retval] int *RetVal);
                [propput, id(3), helpstring("property Label")]
HRESULT
Label([in]
BSTR LabelStr);
                [propget, id(3), helpstring("property Label")]
HRESULT
Label([out,retval] BSTR *RetVal);
                [propput, id(4), helpstring("property WordCount")]
HRESULT
WordCount([in] int Count);
                [propget, id(4), helpstring("property WordCount")]
HRESULT
WordCount([out,retval] int *RetVal);
                [propput, id(5), helpstring("property
MatchcodeStart")] HRESULT
MatchcodeStart([in] ImdMUMatchcodeComponent_MatchcodeStart Start);
                [propget, id(5), helpstring("property
MatchcodeStart")] HRESULT
MatchcodeStart([out,retval] ImdMUMatchcodeComponent_MatchcodeStart
*RetVal);
                [propput, id(6), helpstring("property StartPos")]
HRESULT
StartPos([in] int Pos);
                [propget, id(6), helpstring("property StartPos")]
HRESULT
StartPos([out,retval] int *RetVal);
                [propput, id(7), helpstring("property Trim")] HRESULT
Trim([in]
ImdMUMatchcodeComponent_MatchcodeTrim MatchcodeTrim);
                [propget, id(7), helpstring("property Trim")] HRESULT
Trim([out,retval] ImdMUMatchcodeComponent_MatchcodeTrim *RetVal);
                [propput, id(8), helpstring("property Fuzzy")]
HRESULT
Fuzzy([in]
ImdMUMatchcodeComponent_MatchcodeFuzzy MatchcodeFuzzy);
                [propget, id(8), helpstring("property Fuzzy")]
HRESULT
Fuzzy([out,retval] ImdMUMatchcodeComponent_MatchcodeFuzzy *RetVal);
                [propput, id(9), helpstring("property Near")] HRESULT
Near([in] int
NearVal);
                [propget, id(9), helpstring("property Near")] HRESULT
Near([out,retval] int *RetVal);
                [propput, id(10), helpstring("property FieldMatch")]
HRESULT
FieldMatch([in] ImdMUMatchcodeComponent_MatchcodeFieldMatch
FieldMatch);
                [propget, id(10), helpstring("property FieldMatch")]
HRESULT
FieldMatch([out,retval] ImdMUMatchcodeComponent_MatchcodeFieldMatch
*RetVal);
                [propput, id(11), helpstring("property
MatchcodeSwap")] HRESULT
MatchcodeSwap([in] ImdMUMatchcodeComponent_MatchcodeSwap
MatchcodeSwap);
                [propget, id(11), helpstring("property
MatchcodeSwap")] HRESULT
MatchcodeSwap([out,retval] ImdMUMatchcodeComponent_MatchcodeSwap
*RetVal);
                [propput, id(12), helpstring("property Combination")]
HRESULT
Combination([in] ImdMUMatchcodeComponent_MatchcodeCombination
MatchcodeCombination);
                [propget, id(12), helpstring("property Combination")]
HRESULT
Combination([out,retval] ImdMUMatchcodeComponent_MatchcodeCombination
*RetVal);
        };
        [
                object,
                uuid(138F0163-1D81-4f98-9675-A49E78C7F8B9),
                dual,
                helpstring("ImdMUMatchcode Interface")
        ]
        interface ImdMUMatchcode : IDispatch {
                [propput, id(1), helpstring("property
PathToMatchupFiles")] HRESULT
PathToMatchupFiles([in] BSTR Path);
                [id(2), helpstring("method InitializeDataFiles")]
HRESULT
InitializeDataFiles([out,retval] ProgramStatus *RetVal);
                [id(3), helpstring("method
GetInitializeErrorString")]
HRESULT
GetInitializeErrorString([out,retval] BSTR *RetVal);
                [id(4), helpstring("method FindMatchcode")] HRESULT
FindMatchcode([in] BSTR Matchcode, [out,retval] int *RetVal);
                [id(5), helpstring("method GetMatchcodeName")]
HRESULT
GetMatchcodeName([out,retval] BSTR *RetVal);
                [id(6), helpstring("method GetMatchcodeItemCount")]
HRESULT
GetMatchcodeItemCount([out,retval] int *RetVal);
                [id(7), helpstring("method GetMatchcodeItem")]
HRESULT
GetMatchcodeItem([in] int Item,[out,retval] ImdMUMatchcodeComponent
**RetVal);
        [id(8), helpstring("method GetMappingItemCount")] HRESULT
GetMappingItemCount([out,retval] int *RetVal);
                [id(9), helpstring("method GetMappingItemType")]
HRESULT
GetMappingItemType([in] int Pos,[out,retval]
ImdMUMatchcode_MatchcodeMapping *RetVal);
                [id(10), helpstring("method GetMappingItemLabel")]
HRESULT
GetMappingItemLabel([in] int Pos,[out,retval] BSTR *RetVal);
                [id(11), helpstring("method AddMatchcodeItem")]
HRESULT
AddMatchcodeItem([in] ImdMUMatchcodeComponent *Component,[out,retval]
int *Retval);
                [id(12), helpstring("method InsertMatchcodeItem")]
HRESULT
InsertMatchcodeItem([in] int Pos, [in] ImdMUMatchcodeComponent
*Component, [out,retval] int *Retval);
                [id(13), helpstring("method ChangeMatchcodeItem")]
HRESULT
ChangeMatchcodeItem([in] int Pos, [in] ImdMUMatchcodeComponent
*Component, [out,retval] int *Retval);
            [id(14), helpstring("method DeleteMatchcodeItem")]
HRESULT
DeleteMatchcodeItem([in] int Pos, [out,retval] int *Retval);
                [id(15), helpstring("method Save")] HRESULT
Save(void);
        [id(16), helpstring("method SaveToFile")] HRESULT
SaveToFile([in] BSTR Path);
        };
        [
                object,
                uuid(F5AF53C8-9076-4e2b-9B5B-1ACF12AFC13E), // Get
new
Interface
UUID
                dual,//         dual,
                helpstring("ImdMUReadWrite Interface")
        ]
        interface ImdMUReadWrite : IDispatch {
                [propput, id(1), helpstring("property
PathToMatchupFiles")] HRESULT
PathToMatchupFiles([in] BSTR Path);
                [propput, id(2), helpstring("property
MatchcodeName")]
HRESULT
MatchcodeName([in] BSTR MatchcodeName);
                [propput, id(3), helpstring("property
MatchcodeObject")] HRESULT
MatchcodeObject([in] ImdMUMatchcode  *Matchcode);
                [propput, id(4), helpstring("property KeyFile")]
HRESULT
KeyFile([in] BSTR FileName);
                [id(5), helpstring("method InitializeDataFiles")]
HRESULT
InitializeDataFiles([out,retval] ProgramStatus *RetVal);
                [id(6), helpstring("method
GetInitializeErrorString")]
HRESULT
GetInitializeErrorString([out,retval] BSTR *RetVal);
        [id(7), helpstring("method Initialize")] HRESULT
Initialize(void);
                [id(8), helpstring("method SetLicenseString")]
HRESULT
SetLicenseString([in] BSTR License,[out,retval] int *RetVal);
                [id(9), helpstring("method GetBuildNumber")] HRESULT
GetBuildNumber([out,retval] BSTR *RetVal);
                [id(10), helpstring("method GetDatabaseDate")]
HRESULT
GetDatabaseDate([out,retval] BSTR *RetVal);
                [id(11), helpstring("method
GetDatabaseExpirationDate")] HRESULT
GetDatabaseExpirationDate([out,retval] BSTR *RetVal);
                [id(12), helpstring("method
GetLicenseExpirationDate")] HRESULT
GetLicenseExpirationDate([out,retval] BSTR *RetVal);
                [id(13), helpstring("method GetMatchcodeObject")]
HRESULT
GetMatchcodeObject([out,retval] ImdMUMatchcode **RetVal);
                [id(14), helpstring("method ClearMappings")] HRESULT
ClearMappings(void);
                [id(15), helpstring("method AddMapping")] HRESULT
AddMapping([in]
ImdMUMatchcode_MatchcodeMapping Mapping);
                [id(16), helpstring("method ClearFields")] HRESULT
ClearFields(void);
                [id(17), helpstring("method AddField")] HRESULT
AddField([in] BSTR
Field);
        [id(18), helpstring("method BuildKey")] HRESULT
BuildKey(void);
        [id(19), helpstring("property SetKey")] HRESULT SetKey([in]
BSTR KeyValue);
                [id(20), helpstring("property SetSizeUserInfo")]
HRESULT
SetSizeUserInfo([in] int szUserInfo);
                [id(21), helpstring("method WriteRecord")] HRESULT
WriteRecord(void);
                [id(22), helpstring("method Process")] HRESULT
Process(void);
                [id(23), helpstring("method ReadRecord")] HRESULT
ReadRecord([out,retval] int *RetVal);
                [id(24), helpstring("method GetKey")] HRESULT
GetKey([out,retval]
BSTR *RetVal);
                [id(25), helpstring("method GetUserInfo")] HRESULT
GetUserInfo([out,retval] char **RetVal);
                [id(26), helpstring("method GetDupeGroup")] HRESULT
GetDupeGroup([out,retval] long *RetVal);
                [id(27), helpstring("method GetStatusCode")] HRESULT
GetStatusCode([out,retval] ImdMUReadWrite_StatusCode *RetVal);
                [id(28), helpstring("method GetCount")] HRESULT
GetCount([out,retval] int *RetVal);
                [id(29), helpstring("method GetEntry")] HRESULT
GetEntry([out,retval] int *RetVal);
                [id(30), helpstring("method GetError")] HRESULT
GetError([out,retval] long *RetVal);
                [id(31), helpstring("method GetCombinations")]
HRESULT
GetCombinations([out,retval] long *RetVal);
                [id(32), helpstring("method SetGroupSorting")]
HRESULT
SetGroupSorting([in] int GroupSorting);
        };


[
        uuid(0CD72559-D94C-44b4-8632-3AE28A69E90F), // get new
Library
UUID
        version(1.0),
        helpstring(" mdMatchup 1.0 Type Library")
]
library mdMATCHUPOBJECTLib
{
        importlib("stdole32.tlb");
        importlib("stdole2.tlb");
        [
                uuid(9D883FDD-B0C6-410c-B067-14DCCA2E257B),
                helpstring("mdMUMatchcodeComponent Class")
        ]
        coclass mdMUMatchcodeComponent {
                [default] interface ImdMUMatchcode;
        };
        [
                uuid(1434826C-9759-4708-B89E-3748905158AD),
                helpstring("mdMUMatchcode Class")
        ]
        coclass mdMUMatchcode {
                [default] interface ImdMUMatchcode;
        };
        [
                uuid(4EBAA5B3-7418-4dee-BFF3-5E19F15F1959),
                helpstring("mdMUReadWrite Class")
        ]
        coclass mdMUReadWrite {
                [default] interface ImdMUReadWrite;
        };


--------------------------------------------------------C++ COM Client
Code -------------------------------------------------


// Client.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"


#import "e:\subversion\NameObj\win32_debug\NameObj2.tlb" no_namespace
int main(int argc, char* argv[])
{
        HRESULT hr;


        ImdMUReadWritePtr pReadWriteChecker;
        CoInitialize(NULL);
        hr =
pReadWriteChecker.CreateInstance(_uuidof(mdMUReadWrite));


        if(FAILED(hr)){
                _com_error err(hr);
                printf("%s\n", err.ErrorMessage());
        }
        try {
                bstr_t word=L"LL58JH2Y";
                pReadWriteChecker->SetLicenseString(word);
        }
        catch (_com_error err){
                printf("%s\n",err.ErrorMessage());
        }


        return 0;
}


- Hide quoted text -
- Show quoted text -

2. Asp.Net: Determine Server Side Event Name of Post Back Control - CSharp/C#

3. implementing a server for a HTTP POST using SSL/TLS

"byron guerrero" wrote:

> Please,
> 
> I am new with SSL/TLS, and i am kind of lost, a lot!!!
> 
> i need to receive an xml message from a http post using
> SSL/TLS.

Unless you want to programm the entire web server, there's nothing 
special to do here. Just implement your server-side component, be it 
ASP.NET, a Servlet, a JSP... the web (application) server will take care 
of SSL. Of course you need to set it up properly, e.g. provide a 
certificate.

Cheers,
-- 
Joerg Jooss
 XXXX@XXXXX.COM 

4. How do I do handle a post back even from a button in a server control - CSharp/C#

5. post data with HttpWebRequest to server

6. change settings from an outlook-email-account (post office output server) - CSharp/C#

7. Creating POST data for Server.Transfer()?

I want to programmatically create some POST data on a web server, then pass 
that data to another web page that the server calls, using 
Server.Transfer(). What's the best way to do that?

I'm programming some buttons that link to PayPal's shopping cart. The 
shopping cart needs a bunch of data about the item being added, including 
price. PayPal's sample markup puts the data in a hidden form, which the 
button submits.

I'm concerned about the lack of security in that approach, so I want to have 
the button invoke a method on the server that will assemble the POST data 
that PayPal needs, and then redirect to PayPal. Right now I have a 'button 
dispatch' page, which contains the data assembly and redirect 
(Server.Transfer()) code in its Page_Load event.

What I can't figure out is how to get the POST data into the Request the 
page will submit when it redirects to PayPal. What's the simplest way to do 
this? Are there any examples? Thanks much.

David Veeneman
Foresight Systems





8. Posting to a web server without installing IIS - CSharp/C#