Solved

cannot convert from 'long' to 'LONG *'

Posted on 2004-09-01
1
357 Views
Last Modified: 2012-05-05
I have code below, when i build solution, i get error
error C2440: '=' : cannot convert from 'int' to 'LONG *'
because rep.nbUsersLigne is an INT

how can i convert rep.nbUsersLigne INT to Result LONG*
also,
how can i convert rep.nbUsersLigne LONG to Result LONG*

StreamClient(long UserId, LONG* Result)
{
      ...
      Result=rep.nbUsersLigne;
}

STDMETHODIMP CCom::ADD(LONG UserId, LONG* Result)
{
      StreamClient("SERVERNAME", SERVERPORT, UserId, "ADD","", Result);

      return S_OK;
}
0
Comment
Question by:mammouth
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
ID: 11956519
Try

StreamClient(long UserId, LONG* Result)
{
   // ...
    *Result=rep.nbUsersLigne;
}

This way you will store the value of rep.nbUsersLigne in the LONG variable Result points to.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Handle Exceptions during instantiation 28 423
C++ Language error 28 245
Embarcadero WebBroker REST server endpoint parameters 2 82
No module found pypyodbc, 3 32
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question