|
I wanna to know about this syntax
istream& getline(char *buffer, int length, char terminal_char);
& operator before getline ,what it represent?
Or sometime instead of & there is * also.
What it represent?
Rupal
|
|
|
|
|
hum, i think you need some basic notions about C++.
in such declaration syntax, operator & represent the declaration of a reference, and operator * represent the declaration of a pointer...
in you example, getline get as paramater a pointer to char (buffer), an int (length) and a char (terminal_char). it returns then a reference to an istream instance.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
|
return back the reference of an object
|
|
|
|
|
Rupali Sarda wrote:
What it represent?
Please don't mind, you need read this book, it's contain all the basic concept of c++ Plus it free online http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hello
I have a dialog based application where i am popping a modeless dialog from the OnInitDialog() of this dialog.I alos have a menu in the parent dialog.What i want is that if user clicks on red cross button and calls OnClose()(WM_CLOSE)then only he should be able to create another modeless dialog through menu.How should i override the OnClose and menu handler.I tried to set a variable of my parent dialog in OnClose of modeless dialog and then check it in OnMenu(0 handler but this is not working.Can somebody expalin to me what happens when we click on red cross button of modeless dialog.Do i need to call destroyWindow()?
please help
thanks in advance
|
|
|
|
|
sayup wrote:
How should i override the OnClose and menu handler.I tried to set a variable of my parent dialog in OnClose of modeless dialog and then check it in OnMenu(0 handler but this is not working.
You have to notify the Parent by sending Some Sort of Custom Window Messages! look for WM_APP and WM_USER messages in your locla copy of MSDN
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
When I compiled my project,I got the error messages below:
<br />
fatal error C1001: INTERNAL COMPILER ERROR<br />
(compiler file 'msc1.cpp', line 1786) <br />
Please choose the Technical Support command on the Visual C++ <br />
Help menu, or open the Technical Support help file for more information<br />
I have checked this error number in MSDN,but I can't solve this problem.
So can anybody here do me a favor?
Appreciate.
Oh,by the way,my environment is VC6.0.
Never understand
radical version!
|
|
|
|
|
The compiler cannot generate correct code for a construct, probably due the combination of an expression and an optimization option. Try removing one or more optimization options and recompiling the function containing the line indicated in the error message.
|
|
|
|
|
ILoveCS wrote:
ILoveCS
as your name suggest you love C-Sharp, what are you doing with VC
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
In your eyes,"CS"just means C sharp.
In fact,it can have many kinds of explanation.
For example,Computer Science.
I love C Sharp.
And I love c++ too.
C sharp and C++ don't mind sharing my loves with each other.
hei,guy,maybe you can give me some advice on my problem?
Never understand
radical version!
|
|
|
|
|
ILoveCS wrote:
In fact,it can have many kinds of explanation.
Goos Shot ....
ILoveCS wrote:
maybe you can give me some advice on my problem?
I believe, Mr. Dunn have already given answer to your problem .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
|
Does it make any difference?
I want to know more.
Thank you.
Never understand
radical version!
|
|
|
|
|
|
problem solved.
Thanks a lot!
Never understand
radical version!
|
|
|
|
|
Hi any can tell me how i can make excel addin in vc++
Please help me ,thanks a lot.
|
|
|
|
|
|
when i compiler my project,
ide always show like this:
--------------------Configuration: BlowFish_DEMO - Win32 Debug--------------------
Compiling...
BlowFish_DEMO.cpp
e:\openssl\demo\tellusencryption.h(30) : error C2146: syntax error : missing ';' before identifier 'CONST'
e:\openssl\demo\tellusencryption.h(30) : error C2146: syntax error : missing ';' before identifier 'DEFAULT_BLOWFISH_KEY'
e:\openssl\demo\tellusencryption.h(30) : error C2501: 'CONST' : missing storage-class or type specifiers
e:\openssl\demo\tellusencryption.h(30) : error C2501: 'DEFAULT_BLOWFISH_KEY' : missing storage-class or type specifiers
e:\openssl\demo\tellusencryption.h(33) : error C2146: syntax error : missing ';' before identifier 'BinToHex'
e:\openssl\demo\tellusencryption.h(33) : error C2061: syntax error : identifier 'LPBYTE'
e:\openssl\demo\tellusencryption.h(34) : error C2146: syntax error : missing ';' before identifier 'HexToBin'
e:\openssl\demo\tellusencryption.h(34) : error C2086: 'BOOL' : redefinition
e:\openssl\demo\tellusencryption.h(34) : error C2061: syntax error : identifier 'LPBYTE'
e:\openssl\demo\tellusencryption.h(36) : error C2146: syntax error : missing ';' before identifier 'GetEncryptLength'
e:\openssl\demo\tellusencryption.h(36) : error C2061: syntax error : identifier 'DWORD'
e:\openssl\demo\tellusencryption.h(42) : error C2146: syntax error : missing ';' before identifier 'BlowFishDecrypt'
e:\openssl\demo\tellusencryption.h(42) : error C2086: 'BOOL' : redefinition
e:\openssl\demo\tellusencryption.h(42) : error C2061: syntax error : identifier 'LPBYTE'
e:\openssl\demo\tellusencryption.h(43) : error C2146: syntax error : missing ';' before identifier 'BlowFishEncrypt'
e:\openssl\demo\tellusencryption.h(43) : error C2086: 'BOOL' : redefinition
e:\openssl\demo\tellusencryption.h(43) : error C2061: syntax error : identifier 'LPBYTE'
e:\openssl\demo\tellusencryption.h(44) : error C2146: syntax error : missing ';' before identifier 'HashMD5'
e:\openssl\demo\tellusencryption.h(44) : error C2086: 'BOOL' : redefinition
e:\openssl\demo\tellusencryption.h(44) : error C2061: syntax error : identifier 'LPBYTE'
e:\openssl\demo\tellusencryption.h(45) : error C2146: syntax error : missing ';' before identifier 'HashMD5'
e:\openssl\demo\tellusencryption.h(45) : error C2086: 'BOOL' : redefinition
e:\openssl\demo\tellusencryption.h(45) : error C2061: syntax error : identifier 'LPCTSTR'
e:\openssl\demo\tellusencryption.h(45) : error C2535: 'int __thiscall CTellusEncryption::HashMD5(void)' : member function already defined or declared
e:\openssl\demo\tellusencryption.h(44) : see declaration of 'HashMD5'
e:\openssl\demo\tellusencryption.h(46) : error C2146: syntax error : missing ';' before identifier 'HexHashMD5'
e:\openssl\demo\tellusencryption.h(46) : error C2086: 'BOOL' : redefinition
e:\openssl\demo\tellusencryption.h(46) : error C2061: syntax error : identifier 'LPCTSTR'
e:\openssl\demo\tellusencryption.h(48) : error C2146: syntax error : missing ';' before identifier 'Encode'
e:\openssl\demo\tellusencryption.h(48) : error C2086: 'BOOL' : redefinition
e:\openssl\demo\tellusencryption.h(48) : error C2061: syntax error : identifier 'LPBYTE'
e:\openssl\demo\tellusencryption.h(49) : error C2146: syntax error : missing ';' before identifier 'Decode'
e:\openssl\demo\tellusencryption.h(49) : error C2086: 'BOOL' : redefinition
e:\openssl\demo\tellusencryption.h(49) : error C2061: syntax error : identifier 'LPBYTE'
TellusEncryption.cpp
e:\openssl\demo\tellusencryption.cpp(390) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Generating Code...
Error executing cl.exe.
BlowFish_DEMO.exe - 34 error(s), 0 warning(s)
-----------------------------------------
Please help me ,thanks a lot.
I Love my lover like you do!
|
|
|
|
|
|
I have found this problem ,
the solution is i added <afx.h> in "StdAfx.h",
but it showes the other error:
----------------------------------------------------
--------------------Configuration: BlowFish_DEMO - Win32 Debug--------------------
Compiling...
TellusEncryption.cpp
e:\openssl\demo\tellusencryption.cpp(389) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.
Creating browse info file...
BSCMAKE: error BK1506 : cannot open file '.\Debug\TellusEncryption.sbr': No such file or directory
Error executing bscmake.exe.
BlowFish_DEMO.exe - 2 error(s), 0 warning(s)
I Love my lover like you do!
|
|
|
|
|
Thanks a lot for everybody's favor or attection.
I found the solution in Google Search.
That is to add #include "stdafx.h" in *.cpp file .
I Love my lover like you do!
|
|
|
|
|
hi guys,
currently i am working on a server/client which uses blowfish to encrypt/decrypt the message protocal.
the problem i am facing is i was trying to implement the blowfish that George Anescu provided at (http://www.codeproject.com/cpp/blowfish.asp)
but the result doesn't looks right.
encrypted
0xEA,0xC4,0x60,0x77,
0x14,0x6A,0xBC,0x23,
0x3B,0x36,0xFC,0x34,
0xA0,0xDD,0x82,0xAF,
0xD6,0x9E,0xAB,0x38,
0x05,0xB1,0xE6,0x98,
0x0D,0x2D,0x41,0x44,
0x78,0x22,0x29,0xB6,
0x76,0x62,0x4A,0x79,
0xFE,0x01,0xED,0x06,
0x51,0xE7,0x19,0xE1,
0x35,0x1E,0xAA,0x19
should be decrypted to something like this
0x00,0x74,0x6f,0x72,
0x75,0x6e,0x65,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x63,
0x68,0x65,0x6e,0x77,
0x65,0x69,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x08,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x78,0x16,0x64,0x6e,
0x00,0x00,0x00,0x00
with the encrypt key: [;'.]94-31==-%&@!^+]\0
I have no idea why its wrong.
my test code is following
Blowfish.h
Blowfish.cpp
you can get them at http://www.codeproject.com/cpp/blowfish.asp
<br />
#include <iostream><br />
#include <fstream><br />
#include "Blowfish.h"<br />
<br />
using namespace std;<br />
<br />
void main()<br />
{<br />
try<br />
{<br />
ofstream out("out.txt", ios::trunc);<br />
char ENCRYPTKEY[] = "[;'.]94-31==-%&@!^+]";<br />
unsigned char decrypted[] = {<br />
0x00,0x74,0x6f,0x72,0x75,0x6e,0x65,0x00,<br />
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,<br />
0x68,0x65,0x6e,0x77,0x65,0x69,0x00,0x00,<br />
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,<br />
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,<br />
0x78,0x16,0x64,0x6e,0x00,0x00,0x00,0x00<br />
};<br />
<br />
unsigned char encrypted[] = { <br />
0xEA,0xC4,0x60,0x77,0x14,0x6A,0xBC,0x23,<br />
0x3B,0x36,0xFC,0x34,0xA0,0xDD,0x82,0xAF,<br />
0xD6,0x9E,0xAB,0x38,0x05,0xB1,0xE6,0x98,<br />
0x0D,0x2D,0x41,0x44,0x78,0x22,0x29,0xB6,<br />
0x76,0x62,0x4A,0x79,0xFE,0x01,0xED,0x06,<br />
0x51,0xE7,0x19,0xE1,0x35,0x1E,0xAA,0x19<br />
};<br />
unsigned char szDataOut[48];<br />
CBlowFish oBlowFish((unsigned char*)ENCRYPTKEY, sizeof(ENCRYPTKEY));<br />
oBlowFish.Encrypt(decrypted, (unsigned char*)szDataOut, sizeof(decrypted), CBlowFish::ECB);<br />
out <<szDataOut<<endl;<br />
<br />
memset(szDataOut,0,sizeof(szDataOut));<br />
oBlowFish.Decrypt(encrypted, (unsigned char*)szDataOut, sizeof(encrypted), CBlowFish::ECB);<br />
out <<szDataOut<<endl;<br />
}<br />
catch(exception& roException)<br />
{<br />
cout << "Exception: " << roException.what() << endl;<br />
}<br />
}<br />
-- modified at 22:07 Friday 2nd September, 2005
|
|
|
|
|
I've been looking around in the articles on CStatics as well as in stuff on Bitmaps and the GDI, but I'm not quite finding what I need, so here goes....
What I would like to create is a CStatic-derived class that will make what looks like a partially transparent CStatic. Think of it as a piece of colored glass with text written on it, hovering over the background.
I can handle making a CStatic transparent (there are a couple of nifty articles on that). In essence, taking an image of the part of the parent control behind the CStatic and painting that as the background of the CStatic.
To be more explicit, here's a code snippet for doing basic transparent CStatic:
This is in OnPaint for the CStatic-derived class (so dc is the supplied DC):
CDC* pdcT;
pdcT = new CDC;
pdcT->CreateCompatibleDC(&dc);
CBitmap bitmap;
CBitmap* pOldBitmap;
pOldBitmap = pdcT->SelectObject(&bitmap);
dc.BitBlt(0, 0, rc.Width(), rc.Height(), pdcT, 0, 0, SRCCOPY);
pdcT->SelectObject(pOldBitmap);
delete pdcT;
So what I need to be able to do is modify that "parent" image to add a wash of color, then paint that to the background of the CStatic. It seems that I need to do the modifying of the bitmap after it has been selected into the pdcT, but I don't know where to go on that. Or perhaps I'm missing something that I can do in the BitBlt function to accomplish this.
Can it be done? And if so, how?
Thanks.
|
|
|
|
|