|
different type of class :_) what else!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Can anybody tell me wat is a composite class in C++
|
|
|
|
|
Do you mean composite design pattern [^]?
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
|
|
|
|
|
no...spefically composite class and there is some relation beteween cpmposite and private inheritance.
|
|
|
|
|
Double personality?
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
|
|
|
|
|
not like that..i asked him to post this question..he is my collegue.
|
|
|
|
|
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
If it was an interview then (I insist ) I strongly suspect he was actually referring to the composite design pattern.
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
|
|
|
|
|
I had the same exact thought. Signing up is FREE, you see.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Five millions and growing!
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
|
|
|
|
|
are you talking about the concept of 'Composition' in C++?
Regards,
Vijay.
|
|
|
|
|
You can do a Google search and get the answer.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
|
I have a modal dialog with following properties -
Style - popup
Border - Dialog Frame
Max, min box are both None
Titlebar - true
System menu - true
I am creating the modal dialog on click of a menu-item.
The problem is that the dialog is not sizable. Am I missing something here ?
Thanks
Cage
|
|
|
|
|
cagespear wrote: Border - Dialog Frame
Change border type to Resizing.
|
|
|
|
|
The default border of a dialog box is Dialog Frame. If you want the user to be able to resize a dialog box, set its Border value to Resizing.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
I have to create a propeties file which I would be using in my program. Please help me how should I create a properties file.
thanks.
|
|
|
|
|
What do you mean properties file? Are you talking about writing program setting to a file? If that is that case then you can use ini file (this[^] article makes it east to do so) or you can use XML file. Lot of programs also use windows registry to save their settings.
-Saurabh
|
|
|
|
|
I m new in windows programer.
Anyway, Still i m confuse regarding this.forget aboout linux temporary.
I want to write client socket application using c,c++ language on windows platform on vc++(vc++ console application or win32 static library).
i dont want to use any Winsock API or MFC class for creating and connecting socket.
because when i create socket using winsock API and after that if i use
SSL_read() on the fd retured by winsock API, then it will not working.
for simplicity,
IS it possible to write openssl -based client socket application using c,c++ on windows-vc++ platform without using any winsock class and MFC class
if possible then what i have to do
(1) what openssl version i have to use for windows
(2) what API i have to use for creating socket,connecting socket, reading data and writing data.
right now i m creating socket like this in window using vc++ . I m using window XP
int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) I think in window socket() is defined in winsock.h
now i how i use SSL functionality.
whethere SSL_read() support fd return by WINSOCK API socket. if not then what is the solution.
sorry i m again editing my query.right now i m using
socket() and connect() in vc++(window) then internally they are using winsock only.
now tell me instread of
socket() and connect() what i have to use so that i can use SSL_read and SSL_write()
Regards,
Amit
Regards,
Amit
Edit/Delete Message
modified on Thursday, April 24, 2008 7:40 AM
|
|
|
|
|
AFAIK there's no SSL support in the Windows Sockets library (Winsock).
If you want to roll your own, you'll need to thouroughly understand how SSL works.
Have you looked into using OpenSSL[^]?
Since you have OpenSSL in the topic of this post...um, why aren't you using
the openssl functions for this?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thx Mark for replying me.
I want to write client application on windows operating sysystem(vc++) .
suppose if i creat follow the steps
I m writing steps for client below
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <fcntl.h>
#include <errno.h>
#include <winsock2.h>
#include
#include
#include
#include
#include
#include
(1) create the socket
sock = (sock=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP)
(2) connect the socket to the host
connect (sock, (struct sockaddr*) &sa, sizeof (sa))
(3) now my dought comes,
i want to use openssl API on the socket descriptor sock shown in the above step returned by socket() and connect() of Winsock2.h
steps for this are:
SSL_library_init();
SSL_load_error_strings();
SSLeay_add_ssl_algorithms();
meth = SSLv23_client_method();
ctx = SSL_CTX_new (meth);
SSL_CTX_set_options(ctx,0);
SSL_CTX_set_verify(ctx,SSL_VERIFY_NONE,NULL);
X509_STORE* store = SSL_CTX_get_cert_store(ctx);
X509_STORE_set_flags(store, 0);
ssl = SSL_new (ctx);
BIO* sbio=BIO_new_socket(conn_fd,BIO_NOCLOSE);
SSL_set_bio(pDialerCB->ssl,sbio,sbio);
SSL_set_connect_state(pDialerCB->ssl);
printf("SSL set connect state\n");
peer=SSL_get_peer_certificate(ssl);
after that SSL_read() and SSL_write()
tell me whethere its work or not
Regards,
Amit
|
|
|
|
|
|
Hello,
I am new in WinCE development.
I have to create a hook which monitors foreground windows. If internet explorer window come to foreground then I have to invoke a dialog box.
For that I tried to create hook using SetWinEventHook API which is not supported directly by WinCE.
So we have to update some declarations using winuser.h (general Windows XP, Vista, etc) and have to load coredll.dll
I had tried and getting following errors –
Generating Code...
Compiling resources...
Linking...
MainFrm.obj : error LNK2019: unresolved external symbol "struct HWINEVENTHOOK__ * __cdecl SetWinEventHook(unsigned long,unsigned long,struct HINSTANCE__ *,void (__cdecl*)(struct HWINEVENTHOOK__ *,unsigned long,struct HWND__ *,long,long,unsigned long,unsigned long),unsigned long,unsigned long,unsigned long)" (?SetWinEventHook@@YAPAUHWINEVENTHOOK__@@KKPAUHINSTANCE__@@P6AXPAU1@KPAUHWND__@@JJKK@ZKKK@Z) referenced in function "protected: int __cdecl CMainFrame::OnCreate(struct tagCREATESTRUCTW *)" (?OnCreate@CMainFrame@@IAAHPAUtagCREATESTRUCTW@@@Z)
Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\Release/ScureApp.exe : fatal error LNK1120: 1 unresolved externals
Please have a quick look on my code as follows -
my MainFrm :: OnCreate() contains
g_hHkApiDLL = LoadLibrary(_T("user32.dll"));
g_hHkApiDLLBox = LoadLibrary(_T("coredll.dll"));
if((g_hHkApiDLLBox && g_hHkApiDLL) == NULL)
{
AfxMessageBox(_T("Error to load coredll.dll"));
//something is awfully wrong
//the dll has to be present
return false;
}
else
{
//load the SetWindowsHookEx API call
//the SetWindowsHookEx function installs an application-defined hook procedure into a hook chain.
//You would install a hook procedure to monitor the system for certain types of events.
//here we use use the hook to monitor kyeboard events
LPTSTR pSetWinEventHook;
pSetWinEventHook = (LPTSTR)GetProcAddress(g_hHkApiDLLBox, _T("SetWinEventHook"));
if(pSetWinEventHook == NULL)
{
AfxMessageBox(_T("Error to install hook procedure"));
//this means that MS has really stopped supporting this API in WinCE
return false;
}
else
{
//SetWindowRetProcHook (TRUE);
// hEvtHook = SetWinEventHook (EVENT_MIN, EVENT_MAX,
hEvtHook = SetWinEventHook (EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND,
NULL, ForegroundProc, 0, 0,
WINEVENT_OUTOFCONTEXT);
}
}
My ForgroundProc as follows -
VOID CALLBACK ForegroundProc( HWINEVENTHOOK hWinEventHook, DWORD event, HWND hwnd,LONG idObject, LONG idChild, DWORD dwEventThread, DWORD dwmsEventTime )
{
AfxMessageBox(_T("Inside ForegroundProc"));
TCHAR buf[MAX_PATH];
HWND hWndForeGroundWin = GetForegroundWindow();
if (GetClassName(hWndForeGroundWin, buf, MAX_PATH))
{
if (!_tcsicmp (buf, TEXT("IEFRAME")) ||
_tcsstr (buf, TEXT("Internet Explorer")) ||
!_tcsicmp (buf, TEXT("MozillaUIWindowClass")))
{
AfxMessageBox(TEXT("Found Internet Explorer"));
}
}
}
Also we have declared in header .h file -
HINSTANCE g_hHookApiDLL = NULL; //handle to coredll.dll, where all the hook related APIs are present
HHOOK g_hInstalledLLKBDhook = NULL; //g_hInstalledLLKBDhook represents handle to the installed KB hook
#define EVENT_SYSTEM_FOREGROUND 0x0003
#define WINEVENT_OUTOFCONTEXT 0x0000 // Events are ASYNC
typedef VOID (CALLBACK* WINEVENTPROC)(
HWINEVENTHOOK hWinEventHook,
DWORD event,
HWND hwnd,
LONG idObject,
LONG idChild,
DWORD idEventThread,
DWORD dwmsEventTime);
//typedef HWINEVENTHOOK (WINAPI *SetWinEventHook)(DWORD, DWORD, HMODULE, WINEVENTPROC, DWORD, DWORD, DWORD);
//extern "C"
WINUSERAPI
HWINEVENTHOOK
WINAPI
SetWinEventHook(
__in DWORD eventMin,
__in DWORD eventMax,
__in_opt HMODULE hmodWinEventProc,
__in WINEVENTPROC pfnWinEventProc,
__in DWORD idProcess,
__in DWORD idThread,
__in DWORD dwFlags);
Now request you, please look into the code, and suggest me where I am getting wrong.
Thanks.
Regards,
Shashikant
|
|
|
|
|
Woah, woah
What are you trying to do there ?
Shashi.Shinde wrote: For that I tried to create hook using SetWinEventHook API which is not supported directly by WinCE.
If it is not supported on winCE, then it is not supported. You can't expect to load a dll that was built for windows (desktop) on winCE because these are two different platforms. You can't use a dllthat was compiled for windows on WinCE.
|
|
|
|
|