|
It could be made as following :
...
...
...
unsigned char X1[16];
...
...
extern unsigned char X1[16];
...
...
extern unsigned char X1[16];
...
(The answer would be different
when you would like to share a type (not an instance),
but the X1 is an instance (not a type)... )
virtual void BeHappy() = 0;
|
|
|
|
|
ok thanks
this clarifies it all.
Also presently I did not declare the variables as extern in the header/cpp files.
But I included the declaration of header files as:
Declaration for common_definitions.h, bc.h and rs.h is now changed as:
#ifndef bc_h
#defibe bc_h
-----declaration of bc.h
#endif
#ifndef rs_h
#define rs_h
-----declaration of rs.h
#endif
This also resolved the issue.
|
|
|
|
|
You are welcome !
PS. you could also use:
#pragma once
...
PPS. if you need an own instance in your *.cpp you could also use:
#pragma once
...
typedef struct s {
int m_iVar1;
int m_iVar2;
} myS;
typedef UCHAR myBuffer[16];
...
...and then :
...
#include "CommonSettings.h"
...
myBuffer ownBuffer;
...
...
#include "CommonSettings.h"
...
myS ownS = {0};
virtual void BeHappy() = 0;
|
|
|
|
|
|
Hi i am using VC7 and i want to connect mysql 5.1 through odbc driver mysql 5.0.
i have conncect database by cdatabase class . after successfuly open the database we called open method of Crecordset but it give exception.
CRecordSet rs(m_db);//
rs.open(CRecordSet::Dynaset,"Select * form Tablename",CRecordSet::none);
above line guve exception aboiut dynaset. we are unable to call open function of Crecordset.
but CRecordSet::snapshot work fine.
|
|
|
|
|
Please check CDBException::m_strError : it should give you useful info about the problem.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
i got proper exception in case of "Creordset::dynaset".
How can call open method of Crecordset with Creordset::dynaset to fetch record from Mysql
|
|
|
|
|
shivanandgupta wrote: i got proper exception in case of "Creordset::dynaset".
What is 'proper exception'?
Why didn't you report the erreor message?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello people!
If i want to encrypt some data based on a key (password) and want to keep the encryption as irreversible without the key as possible (yeah, i know, that's the point), which algorithm would you recommend? The data itself would mostly be text and only 1-2 megabytes tops, so if the choice is between safer or faster, i'd choose safer. Thanks for your oppinions.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
For encrypting that much data (1-2 MB) you must use any symmetric algorithms like RC2, RC4, or Data Encryption Standard (DES)
|
|
|
|
|
Thank you, i will check these out.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Don't use DES any more! Its not safe because the key is only 56 bit long. You can "hack" it, with some good machines in under a day!
Use AES (128-256 bit) (Advanced Encryption Standard) or maybe, if AES not available, 3DES instead.
Greetings
Covean
|
|
|
|
|
Btw are these freely usable?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
In .NET there are some crypto provider you can use for "free" for example 3DES / TripleDES.
.NET 3.5 also introduced AES.
I don't know if there are also libs for C++ but I can't imagine that there aren't some in the internet (for free). If you don't find anything about AES look for Rijndael its the same algorithm.
Greetings
Covean
|
|
|
|
|
Thank you very much.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
You are welcome.
Greetings
Covean
|
|
|
|
|
I am using pen to plot lines in graph
hpen = CreatePen(PS_SOLID, thickness, rgb);
even after giving the thinkness parameter as 5 . thickness of the line still remain same as if we put zero...
is there any thing i m missing to add
or any code or api to increase thickness of the line
pls help me to come out of this mess
thanks in advance............
|
|
|
|
|
Could you please post the relevant code?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
int paint_line(HWND hwnd, HDC hdc, int x0, int y0, int x9, int y9, int thickness, COLORREF rgb)
{
HBRUSH hbr; HPEN hpen, hpen_sav;
hpen = CreatePen(PS_SOLID, thickness, rgb);
hpen_sav = (HPEN) SelectObject(hdc, hpen);
hbr = (HBRUSH)SelectObject(hdc, GetStockObject(NULL_BRUSH));
MoveToEx(hdc, x0, y0, NULL);
LineTo(hdc, x9, y9);
DeleteObject(SelectObject(hdc, hbr));
SelectObject(hdc, hpen_sav);
DeleteObject(hpen);
return 0;
}
|
|
|
|
|
Your code is fine, I called it this way:
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
paint_line(hWnd, hdc, 0, 0, 400, 400, 5, RGB(255,0,0));
EndPaint(hWnd, &ps);
break;
and got a beautiful red thick line in my window.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I m working on a maintanance project which is too big.
the same code which i send to you is been used in my project but its not working .is there any possiblity to set some default thickness of lines throughout the graph.i scare that like that some handling has been done ..
because i even tried till 50...
|
|
|
|
|
thanks pallini
it worked when i gave thickness as 300
thanks a lot for spending time for me...
|
|
|
|
|
Have you set any mapping mode at the DC ?
(did you tried with thickness = 100 ?)
virtual void BeHappy() = 0;
|
|
|
|
|
sorry Eugen
i am a beginer.I am not sure with Mapping Mode
|
|
|
|
|
Could you post your calling context of the function too ?
(it is a function that does call the paint_line(..) function)
virtual void BeHappy() = 0;
|
|
|
|