473,508 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with "x" differs in levels of indirection from "y"


Hello

I have a problem with an error message. I created a new class (as
OpenSSL helper):

class DataBlock
{
public:
DataBlock();
DataBlock( unsigned int size );
DataBlock( const DataBlock& copy );
DataBlock( const unsigned char* copy, unsigned int copySize );
~DataBlock();
// .... methods and datas...
};

Then i use the class in this way:

void foo()
{
unsigned char* sessionKey[1];
sessionKey[0] = new unsigned char[ EVP_PKEY_size( publicKey ) ];
int sessionKeySize[1];
// (...) call the openssl functions

// problem:
DataBlock sessionKey( sessionKey[0], sessionKeySize[0] );
}

I get the error message (vsc++.net):
error C2040: 'sessionKey' : 'DataBlock' differs in levels of indirection
from 'unsigned char *[1]'

I think i overlooked a fault, but i'd see it... (frustrating... *sigh*)

best regards
Tobias Erbsland
Jul 22 '05 #1
2 2682

"Tobias Erbsland" <ne***********@tracker.drzoom.ch> wrote in message
news:ca**********@atlas.ip-plus.net...

Hello

I have a problem with an error message. I created a new class (as
OpenSSL helper):

class DataBlock
{
public:
DataBlock();
DataBlock( unsigned int size );
DataBlock( const DataBlock& copy );
DataBlock( const unsigned char* copy, unsigned int copySize );
~DataBlock();
// .... methods and datas...
};

Then i use the class in this way:

void foo()
{
unsigned char* sessionKey[1];
sessionKey[0] = new unsigned char[ EVP_PKEY_size( publicKey ) ];
int sessionKeySize[1];
// (...) call the openssl functions

// problem:
DataBlock sessionKey( sessionKey[0], sessionKeySize[0] );


sessionKey has already been defined in the code. If your intention is to create
a new object of type DataBlock then use some other variable name.

s(sessionKey[0], sessionKeySize[0] );


Jul 22 '05 #2
>>unsigned char* sessionKey[1];
sessionKey[0] = new unsigned char[ EVP_PKEY_size( publicKey ) ];
int sessionKeySize[1];
DataBlock sessionKey( sessionKey[0], sessionKeySize[0] );

sessionKey has already been defined in the code. If your intention is to create
a new object of type DataBlock then use some other variable name.


Thank you very much! (such a stupid mistake ;-)

best regards
Tobias
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2027
by: Andreas Suurkuusk | last post by:
Hi, I just noticed your post in the "C# memory problem: no end for our problem?" thread. In the post you implied that I do not how the garbage collector works and that I mislead people. Since...
5
9518
by: George Copeland | last post by:
This is a request for help fixing a SQL Server 2000/ADO problem on Windows XP. I would appreciate any useful assistance. PROBLEM: SQL Server access on my machine fails as follows: 1. All of...
5
1634
by: Michael Olea | last post by:
Here is a design problem I ran into this am - and I have cleaned the bathroom, scrubbed toilet sink and tub, windexed all glass, mopped the floor, and vacuumed the house - no dice, the problem is...
10
7117
by: Michael Strorm | last post by:
Hi! I've been having problems with a DTD. Having had the Sun XML validator reject a document, I put it through 'xmllint' for more information. 'Xmllint' noted a problem with the DTD itself;...
0
2970
by: maxim mat | last post by:
Hi I need to build client for web service. But when I'm using Visual Studio .NET to add Web Reference, I get error: "Custom tool error: Unable to import WebService/Schema. Unable to import...
0
1630
by: Norman Yuan | last post by:
I posted this issue a while ago. After moveing the ASP.NET 1.1 app to a brand new server, the same problem still there. System: Winows2003 server std. .NET 1.1 App: Invoicing system Problem:...
0
5577
by: cherryparadise001 | last post by:
Hi All, I have moved an asp system from Window Server 2000 to Window Server 2003 recently. Many error occured and most of them are unable to get the control's value in the page. I am newbie to...
10
21790
by: Ole | last post by:
Hi, Using VS2005 and a windows CE 5.0 device running CF2. Suddenly I can't debug my C# program from VS2005 - when setting a breakpoint I only see a ring instead of the normal red dot and when...
9
9667
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
1
1509
by: eggie5 | last post by:
I am sending and receiving data from my client/server using the JSON format. However, it turns out, a lot of the time, that data has ":" or " ' " characters in it, which causes the the javascript...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1557
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.