|
Hi ,
I want to do an Encyption Progrma. I got a sample code from MSDN site. When I am compling that Program some varibles & Functions showing error as Undeclared identifier. HCRYPTPROV, HCRYPTKEY, CryptAcquireContext() etc....
I have included the "Wincypt.h"
Can anyone help me to sove this error?
Thanks in Advance
SAN
|
|
|
|
|
Try this:
#define _WIN32_WINNT 0x0500
--
karl
|
|
|
|
|
Hey everyone!
I put myself a string class in C++ together, and now I want an easy way to initialize it with some string. One thing is the constructor that takes a LPCTSTR-type as an argument, in the fashion of cString (LPCTSTR somestring). Now I'd like to be able to do something like:
cString *bunchachars = new cString ();
bunchachars = "Now here comes the filling";
I did a little of research on the internet, and two terms I came across (that I could imagine being applied here) were the = operand and the cast-constructor. Can anyone give a little detail on this, or just tip me into the right direction?
cheers
tilli
|
|
|
|
|
tilli again wrote:
Can anyone give a little detail on this, or just tip me into the right direction?
You should REALLY read the code of the std::string class (and its definition http://www.sgi.com/tech/stl/)as well as the CString -code from MFC.
There is no point in reinventing the wheel - at least interface-wise.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Well, I'm writing my own Win32 API wrapper, just for not having to use MFC (personal choice and just a fun thing). I don't wanna end up having to use any of these huge libraries. Still, it might make sense to see how it was done in the std::string class, thanks for the hint!
|
|
|
|
|
From the looks of it, you're coming from some garbage-collected language such as Java or C#. In C++ you can allocate objects on the stack just like ints and longs. So you can do this:
cString str;
str = "whatever";
or
cString str = "whatever";
cString str("whatever");
If you have a pointer, like in your example, you must "dereference" it:
cString *bunchachars = new cString;
*bunchachars = "Now here comes the filling";
Regards,
Alvaro
There are no stupid questions, but there are a lot of inquisitive idiots. -- despair.com
|
|
|
|
|
I've successfully use GetCursorPos() and WindowFromPoint() to get the window handle. Then I use SendMessage() to send "WM_COPY" to that application, so that I can copy the selected text to the clipboard for my application. This method success in notepad. But when I try this method in openoffice, it failed.
Openoffice seems doesn't accept the message "WM_COPY". Does anyone know how can I get the selected text from openoffice? Thanks a lot.
|
|
|
|
|
What about other application like MS IE and outlook express?
|
|
|
|
|
MS IE and Netscape failed using this method.
But MS Word is okay.
|
|
|
|
|
Please let me know if you have any tool like grpof (in linux) on windows, which gives the detailed timing analysis.
Also need some tool which gives the detailed timing analysis in VC++ code.
|
|
|
|
|
|
Visual Studio has its own profiler - you can enable it by changing the project settings
|
|
|
|
|
But it isn't available in all VC++ 6.0 flavours; I have MSDN Enterprise, but I don't think it's available in the "Learning" or Personal edition, whatever it's called.
Steve
Steve S
[This signature space available for rent]
|
|
|
|
|
I am using ShellExecute() function to open MSPaint from my MFC application. This opnes paint successfully,but gives
debug assetion failure error to my application.
this happnes with ShellExecute(),Winexec() & CreateProcerss()
What is going wrong?
My PC configuration is
OS->win98
RAM 128MB
VC6.0
PIII processor 533
.
|
|
|
|
|
Youre string operation seems to be buggy. Try: GetBuffer and GetLength operations.
The first thing should be start the app without params, than build the more complex thing.
What replies GetLastError() and haven´t you set all the flags of the command right?
Try this @ home. (B&B)
|
|
|
|
|
Run the debug build in the debugger, press Retry at the Assert and then you will see what the complaint is about and should be able to fix it.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Pleae tell me which one of the following programs is most efficient,thanks.
1.
#include <iostream.h>
class A
{
public:
int x ;
A(int i) { x=i ; }
} ;
void main()
{
int i;
cout <<"Enter i " ;
cin>>i ;
A a(i);
cout << "a.x=" << a.x << endl ;
}
2.
#include <iostream.h>
class A
{
public:
int x ;
A(int i) : x(i) {}
} ;
void main()
{
int i;
cout <<"Enter i " ;
cin>>i ;
A a(i);
cout << "a.x=" << a.x << endl ;
}
3.
#include <iostream.h>
class A
{
public:
int x ;
} ;
void main()
{
int i;
cout <<"Enter i " ;
cin>>i ;
A a ;
a.x=i ;
cout << "a.x=" << a.x << endl ;
}
|
|
|
|
|
None of them are standard C++, because they either won't compile, or you included iostream.h, which is not part of standard C++. Inclide iostream instead, and put using std::cout;, etc. for the bits you want to use.
Also, void main is not valid C++, main must return int.
I doubt any of them is more efficient in any real terms.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
|
|
|
|
|
dear all,
how can i get the Last Modification Date Of any File (Not the Creation date) using API.
thanx
|
|
|
|
|
Easy one! : take a look at
BResultGetFileTime = GetFileTime(hFile,&ftCreacio,&ftDarrerAcces,&ftLastModification);
Hope this helps...
|
|
|
|
|
You can use the CFileStatus class along with CFile::GetStatus function to get the modified time. CFileStatus class contains a CTime member m_mtime.
|
|
|
|
|
Is it possible to built an EXE File With Exports? Forget about COM server Exes...
Vikrams
|
|
|
|
|
Yes it is quite possible to export functions from an exe as we export from a dll. You can add global function in your exe and use the extern "C" _declspce(dllexport) with the function declaration.
use loadLibrary and GetProcAddress to load this exe and call the exported function in it. Don't forget the declare the function before using it by using the keyword _declspec(dllimport).
|
|
|
|
|
I declared one funcion into my win32 EXE as
extern "C" __declspec(dllexport) void Function(void){
MessageBox(NULL,"","",MB_OK);
}
and user in other win32 EXE as
typedef void (*FUNCTION)();
FUNCTION Function=NULL;
HINSTANCE MyInstance=LoadLibrary ("c:\\ExeFile.exe");
if(MyInstance){
Function=(FUNCTION)GetProcAddress(MyInstance,"Function");
if (Function)
{
Function();
}
But It Gives me access violation Error...
Vikramvs
|
|
|
|
|
Instead of the MessageBox, if you return some value, it will work. So, based on this return value you can display the message box in your application.
|
|
|
|