Solved

cannot convert from 'long' to 'LONG *'

Posted on 2004-09-01
1
371 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

688 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