Although pData->Count returns a 5 (5 protocols available), pData->Protseq[i] simply returns 'n' which I believe is the first character of the protocol sequence.
fyi the environment I am working in does not allow for 'std::cout'. I have to convert everything to a char* or a wchar_t* to output it. Could this be my problem.
For instance, my code looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13
RPC_PROTSEQ_VECTOR *ProtSeqVector = NULL;
status = RpcNetworkInqProtseqs(&ProtSeqVector);
if(status==RPC_S_OK) RhinoApp().Print("RpcNetworkInqProtseqs = SUCCESS!!!\n");
if(status==RPC_S_NO_PROTSEQS) RhinoApp().Print("RpcNetworkInqProtseqs = No supported protocol sequences.\n");
int pCount = ProtSeqVector->Count;
for (int i = 0; i < pCount; ++i)
{
RhinoApp().Print("Protseq = ");
RhinoApp().Print((char*)ProtSeqVector->Protseq[i]);
RhinoApp().Print("\n");
}
And it returns this:
RpcNetworkInqProtseqs = SUCCESS!!!
Protseq = n
Protseq = n
Protseq = n
Protseq = n
Protseq = n
RpcBindingFromStringBinding = The protocol sequence is not valid.
Each of those 'n' should be a different RPC Protocol sequence like "ncacn_ip_tcp".
1. You must read my reply in this thread: http://www.cplusplus.com/forum/general/56526/
2. You must re-read my code above and carefully note the letter "A" at the end of RPC_PROTSEQ_VECTORA and at the end of RpcNetworkInqProtseqsA().
If you did #1 then it should be obvious now that you can change the ending "A" for an ending "W" and obtain wide strings instead of ANSI strings if so you desire.
I noticed the 'A' before but assumed that was predetermined in one of my header files.
I also don't understand why there is no reference to RPC_PROTSEQ_VECTORA on the MSDN.
I am swimming in the deep end and your help is appreciated!!!
RPC people are hard to find so I was hoping I could turn your attention to another question I have:
When tweeking my code I accidentally generated an error which referenced ''RpcStringBindingComposeW' so as per your instructions (sort of) I went back into my code and added 'A' to my other RPC function calls (RpcStringBindingCompose, RpcStringBindingParse and RpcBindingFromStringBinding) and changed all my RPC_WSTR types to RPC_CSTR and SUCCESS!!!