Solved

cannot convert from 'long' to 'LONG *'

Posted on 2004-09-01
1
326 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now