|
Hi All
I am able to connect mysql through ODBC.But i want to know there is any method to connect Mysql without Odbc?
Plz help me
|
|
|
|
|
Here's[^] the list of connectors that are provided with MySQL - there's a C++ one...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I have seen a simple program which opens a browser, loads a login page and auto populate username and password... so it was like using DOM of a newly opened window from windows program. can i have the name of the topic under where DOM is covered in win32 or if i could get links to other resources regarding this then that will be nice...
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
You could either start at MSHTML Reference[^] or by looking at the IHTMLDocument2[^] interface.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Let me redefine my question.
I want to access any windows input elements from a win32 or mfc program.
i want to open browser from a win32 program and want to manipulate the contents...
this is my idea and i want to know which of the concepts does this work either in win32 or in mfc.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
How to create context menu, that shows up when right mouse button was clicked on a file in Windows Explorer? It is important to do this using native Win32, without MFC, WTL, Afx or CLR.
|
|
|
|
|
shasa2009 wrote: How to create context menu, that shows up when right mouse button was clicked on a file in Windows Explorer
Explorer already creates a context menu when you right click on a file or folder. If you want to extend or interact with the context menu then you should read the article by Michael Dunn. It contains everything you need to know regarding shell extensions.
The Complete Idiot's Guide to Writing Shell Extensions - Index[^]
Best Wishes,
-David Delaune
|
|
|
|
|
I need to display explorer context menu in my program. I do not need to extend or modify it. "The Complete Idiot's Guide to Writing Shell Extensions" it is all about how to extend or modify, but i do not need it.
BOOL showContextMenu (HWND hWnd, TCHAR* fullPart)
{
return TRUE;
}
|
|
|
|
|
shasa2009 wrote: I need to display explorer context menu in my program. I do not need to extend or modify it.
Ok I am sorry but I dont understand your question. Your original question asked how to create a popup context menu[^] when you right click a file in windows explorer[^]?
Best Wishes,
-David Delaune
|
|
|
|
|
|
hello, i want to build a chat engine using MFC c++. what classes of MFC i need can anyone tell me? and i need using procedure of these classes. plz tell me detail about procedure of building chat engine.i want to use MFC classes.
plz help me.
|
|
|
|
|
What is a 'chat engine'? Could you elaborate on your requirements or technical problems?
/M
|
|
|
|
|
its a web chat engine like yahoo messengers.i dont need clone of messenger. only need to transfer a string and receive a string between two people.i want to use c++ MFC. now list me plz needed c++ MFC classes/functions to build it.plz tell me detail how i have to go ahead.tell me step by step to build this web chat engine.
|
|
|
|
|
|
I am looking for an example of code for getting video "capture" from camera to AVI file using AVI stream in plain C++. I need to use the camera data as document (file) in MFC.
There is plenty of sample code (and applications) in here but they all either use C# ,framework library or just read from AVI file.
Thanks for reading Vaclav
|
|
|
|
|
|
Thanks, it does help somewhat. It seems to be just a wrapper for AVI API.
And unless I missed something - it does "takes" the data from a AVI file.
What I am looking for is data coming from video camera. I got it working using capture frames but it does not "fit" into document / view architecture. It needs a capture window and by definition a document does not have a window attached.
I hope I am not totally wrong but how do you tell the stream AVI which device to read from – I’ll need few cameras to accomplish my task.
Thanks for your help.
Cheers Vaclav
|
|
|
|
|
hmm... i think you'll need DirectX, then.
|
|
|
|
|
I believe the DirectX AMCap sample is what you need.
Download and install the latest Windows SDK from Windows SDK for Windows Server 2008 and .NET Framework 3.5[^]
You will find the AMCap sample at the location C:\Program Files\Microsoft SDKs\Windows\v6.1\Samples\Multimedia\DirectShow\Capture for the default installation path.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
OK, I am downloading it now. Four hours estimate... good night..
Hopefully I can use it on WIndows 2000. .NET won't load on it, but I do not want .net just the sample code.
Thanks Vaclav
|
|
|
|
|
hi,
i can't run this program why
there is 1 error what is it?
#include "stdafx.h"
#include <dsa.h>
using CryptoPP::DSA;
using CryptoPP::DSA_DER;
using CryptoPP::DSA_P1363;
#include <pubkey.h>
using CryptoPP::PrivateKey;
using CryptoPP::PublicKey;
#include <osrng.h>
using CryptoPP::AutoSeededRandomPool;
#include <files.h>
using CryptoPP::FileSource;
using CryptoPP::FileSink;
using CryptoPP::StringSource;
using CryptoPP::StringSink;
bool CreateDSAKeys();
bool SignDSAMessage();
bool VerifyDSAMessage();
int main(int argc, char* argv[])
{
CreateDSAKeys();
SignDSAMessage();
VerifyDSAMessage();
return 0;
}
bool CreateDSAKeys()
{
AutoSeededRandomPool prng;
try
{
// Crypto++ Key Generation
DSA::Signer signer;
PrivateKey& privateKey = signer.AccessPrivateKey();
privateKey.GenerateRandom( prng );
DSA::Verifier verifier( signer );
PublicKey& publicKey = verifier.AccessPublicKey();
// Crypto++ Save Keys
privateKey.Save(FileSink("private.dsa.cpp.key"));
publicKey.Save(FileSink("public.dsa.cpp.key"));
}
catch( CryptoPP::Exception& ex )
{
cerr << "Caught Error:" << endl;
cerr << " " << ex.what() << endl;
return false;
}
catch( std::exception& ex )
{
cerr << "Caught Error:" << endl;
cerr << " " << ex.what() << endl;
return false;
}
return true;
}
bool VerifyDSAMessage()
{
try
{
//
// Crypto++ Load the Pubic Key
//
DSA::Verifier verifier;
PublicKey& publicKey = verifier.AccessPublicKey();
// publicKey.Load(FileSource("public.dsa.cpp.key", true));
// publicKey.Load(FileSource("public.dsa.java.key", true));
publicKey.Load(FileSource("public.dsa.cs.key", true));
//
// Retrieve the Message and the Signature on Message
//
string message, signature;
// C++
FileSource( "dsa.cpp.msg", true, new StringSink( message ) );
FileSource( "dsa.cpp.sig", true, new StringSink( signature ) );
// Java
// FileSource( "dsa.java.msg", true, new StringSink( message ) );
// FileSource( "dsa.java.sig", true, new StringSink( signature ) );
// C#
// FileSource( "dsa.cs.msg", true, new StringSink( message ) );
// FileSource( "dsa.cs.sig", true, new StringSink( signature ) );
//*
// --- Begin Java Specific Conversion ---
//
// Convert: DER -> P1363
//
// Java is DER Encoded Sequence.
// Crypto++ is P1363 format.
/*
{
// From dsa.h: If toFormat == DSA_P1363,
// bufferSize must equal publicKey.SignatureLength()
size_t length = verifier.SignatureLength();
// A buffer for the conversion
byte* buffer = new byte[ length ];
// Sh*t or Go Blind. You make the choice.
if( !buffer ) { return false; }
// Reuse length
length = CryptoPP::DSAConvertSignatureFormat(
buffer, length, DSA_P1363, (const byte*)signature.c_str(),
signature.length(), DSA_DER );
// Reinitialize signature so that it can be used
// in the verifier below with minimal effort
signature = string( (const char*)buffer, length );
delete[] buffer;
}
*/
// --- End Java Specific Conversion ---
//*/
//
// Verify the Signature on the Message
//
bool result = verifier.VerifyMessage(
(const byte*)message.c_str(), message.length(),
(const byte*)signature.c_str(), signature.length() );
if( result )
{
cout << "Signature on Message verified" << endl;
}
else
{
cerr << "Signature on Message not verified" << endl;
return false;
}
//
// Convert the Message
//
int nChars = MultiByteToWideChar( CP_UTF8, 0,
message.c_str(), -1, NULL, NULL );
wchar_t* p = new wchar_t[ nChars ];
if( !p ) { return false; }
MultiByteToWideChar( CP_UTF8, 0, message.c_str(), -1, p, nChars );
wstring wide( p );
delete[] p;
}
catch( CryptoPP::Exception& ex )
{
cerr << "Caught Error:" << endl;
cerr << " " << ex.what() << endl;
return false;
}
catch( std::exception& ex )
{
cerr << "Caught Error:" << endl;
cerr << " " << ex.what() << endl;
return false;
}
return true;
}
bool SignDSAMessage()
{
try
{
//
// Crypto++ Load Private Key
//
DSA::Signer signer;
PrivateKey& privateKey = signer.AccessPrivateKey();
privateKey.Load(FileSource("private.dsa.cpp.key", true));
// Convert the Message
wstring wide = L"Crypto Interop: \u9aa8";
int nChars = WideCharToMultiByte( CP_UTF8, 0,
wide.c_str(), -1, NULL, 0, NULL, FALSE );
char* p = new char[ nChars ];
if( !p ) { return false; }
nChars = WideCharToMultiByte( CP_UTF8, 0,
wide.c_str(), -1, p, nChars, NULL, FALSE );
string narrow( p );
delete[] p;
//
// Sign the Message
//
// Set up for SignMessage()
byte* s = new byte[ signer.MaxSignatureLength() ];
if( !s ) { return false; }
// Sign...
AutoSeededRandomPool prng;
size_t length = signer.SignMessage( prng,
(const byte*) narrow.c_str(), narrow.length(), s );
// Convenience
string signature( (const char*)s, length );
// --- Begin Java Specific Conversion ---
//
// Convert: P1363 -> DER
//
// Crypto++ uses P1363 format.
// Java requires a DER encoded sequence.
/*
{
// Determine size of required buffer
// We can call with a null buffer and 0 size
// when going in this direction
length = CryptoPP::DSAConvertSignatureFormat(
NULL, 0, DSA_DER, (const byte*)signature.c_str(),
signature.length(), DSA_P1363 );
// A buffer for the conversion
byte* buffer = new byte[ length ];
// Sh*t or Go Blind. You make the choice.
if( !buffer ) { return false; }
// Reuse length
length = CryptoPP::DSAConvertSignatureFormat(
buffer, length, DSA_DER, (const byte*)signature.c_str(),
signature.length(), DSA_P1363 );
// Reinitialize signature so that it can be used
// in the verifier below with minimal effort
signature = string( (const char*)buffer, length );
delete[] buffer;
}
*/
// --- End Java Specific Conversion ---
//
// Save the Message and the Signature on Message
//
// mofs: message filestream
// sofs: signature filestream
ofstream mofs, sofs;
mofs.open("dsa.cpp.msg", ios_base::binary | ios_base::trunc );
sofs.open("dsa.cpp.sig", ios_base::binary | ios_base::trunc );
// Save Original Message
mofs.write( narrow.c_str(), (int)narrow.length() );
// Save Signature on Message
sofs.write( (const char*)signature.c_str(), (int)length );
// Cleanup
sofs.close();
mofs.close();
}
catch( CryptoPP::Exception& ex )
{
cerr << "Caught Error:" << endl;
cerr << " " << ex.what() << endl;
return false;
}
catch( std::exception& ex )
{
cerr << "Caught Error:" << endl;
cerr << " " << ex.what() << endl;
return false;
}
return true;
}
|
|
|
|
|
sarroya wrote: there is 1 error what is it?
1/ Read the sticky posting about how to post a good question... And to use an actual subject line.
2/ This isn't a quiz area. If you want to know what's wrong, try and compile it yourself and look at the messages.
After you've fixed it, try single stepping through to see if it behaves as you expect.
3/ I wish you luck when you can narrow down your problem and edit your question.
Best of success,
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi,
I did following, but I got an error.
pPopupMenu = new CMenu();
if( pPopupMenu->CreatePopupMenu())
{
pPopupMenu->LoadMenu(MAKEINTRESOURCE(MENUID); --------------> ERROR
}
I can not use "LoadMenu" for popupmenu? How can I fix?
Best regards,
|
|
|
|
|
I thought you can use it, too [*] - but you will need to add an extra ")" to close the function.
Iain.
[*] can't look and be 100% sure.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Sorry, that is my typo here.
The program stops at:
BOOL CMenu::Attach(HMENU hMenu)
POPUP MENU
BEGIN
POPUP ""
BEGIN
MENUITEM "Edit", ID_EDIT
MENUITEM "Object ...", ID_OBJECT
MENUITEM SEPARATOR
MENUITEM "Text...", ID_TEXT
END
END
"hMenu" is NULL. Why "hMenu" is null, I created the menu.
Thanks,
|
|
|
|
|