|
hi,
i want to ask the Event handle returned from createevent method is shared among different process or it is secured of being used by different process.the first aurgument i 've supplied to the method is null.
if is not secured , then how can it be made protected of begin used by different process.
thnaks in advance
khurram mirza
|
|
|
|
|
AFAIK the only way you can share HANDLEs between processes is by DuplicateHandle and starting the other processes as "children" from this "parent" process that created the handle.
This is AFAIK all documented in MSDN and other sources.
|
|
|
|
|
|
Hi all,
I want to find the details of all the clients in my network. How I can do that?? I feel SNMP is having the limitation of enable that service in all the clients. Is there any other option left?? I am a developer in C++. Can any body suggest some API's or Links.
Thanks in advance,
Regards,
Satya Prasad
|
|
|
|
|
What "details"? What "clients"? What "my network" (your CIDR/n subnet or "My Network" according to MS)?
To perhaps point you in the right direction:
Whatever information you want any single machine to provide you with, that machine must have a service/server to provide you with that information. Unless you specify what information you want, it's impossible to even give a remotely correct answer by anything but pure coincidence.
|
|
|
|
|
If you want to enumerate your network resources, there are some cool API calls you can make. The example is given in MSDN documentation. You could enumerate from your program all the printers, machines, etc. on the network.
|
|
|
|
|
Hi,
Sorry I didn't put my question correctly. I am having a private network. I want to get the Client details like MAC, OS and others. I don't want to use SNMP. In that case how to do this?? Thanks
Regards,
Satya.
|
|
|
|
|
1. In MSDN, the disactive Page not initialize if you not click it, how can I initialize all page when the sheet is shown?
2. When I use the function "UpdateDialogControls" in a CPropertyPage, in Debug mode, it works perfectly, but in release mode, some warning will be shown, and the applications will destory, why?
|
|
|
|
|
about 1:
i don't understand your problem, Isn't all we need
to addpage before creating the propertysheet? Then all the page you add will be shown.
|
|
|
|
|
In MSDN, the Method "AddPage"'s describe, MS told us "AddPage adds the CPropertyPage object to the CPropertySheet object’s list of pages but does not actually create the window for the page. The framework postpones creation of the window for the page until the user selects that page.", so if I don't click the page, the page's member can not be accessed or make a exception. But if I click the page, the "OnInitDialog" will be executed, so I can access the page's member when the sheet destory. so I need initialze the all pages when the sheet be shown, the all pages's "OnInitDialog" will be executed.
|
|
|
|
|
During the constructor, modify the m_psp struct of the newly added property page in this way:
this->m_YourPropertyPageDlg.m_psp.dwFlags |= PSP_PREMATURE;
hope this helps.
|
|
|
|
|
|
Thank you !!
please see the picture .
the rigth button's code is here
{
CMainFrame *pMain=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CSuiZhongView *pView=(CSuiZhongView*)pMain->GetActiveView();
CEdit* pE=(CEdit*)m_wndDlgBar.GetDlgItem(m_edit);
CString szO;
pE->GetWindowText(szO);
if(szO!="µ¥Î»Àà±ð")
{
pView->FindData(szO);;
}
}
yes is pass ,can find the data I need.
but ,when I change the item of the tree ,vc only say "yes"
then fail.
why?
Here is the Treeviewclass' code!!!
CTreeViewClass::OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
CMainFrame *pMain=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CSuiZhongView *pView=(CSuiZhongView*)pMain->GetActiveView();
HTREEITEM hti = m_TreeCtrl->GetSelectedItem();
if (hti)
{
CString str = m_TreeCtrl->GetItemText(hti);
if(str!="µ¥Î»Àà±ð")
{
pView->FindData(str);;
}
}
}
//ÕâÊÇListViewµÄ½ÓÊÜ´úÂë
//Here is the code of list view
void CSuiZhongView::FindData(CString data_)
{
AfxMessageBox("yes");
m_pListCtrl->DeleteAllItems();
int nI;
CString strSQL,strCurItem;
_variant_t yonghuming,yonghuhao,daiwei,taiquhao,taiquming,benyue,shangyue,dianliang,yue;
strSQL="SELECT * FROM Ïêϸ where µ¥Î» like '%" ;
strSQL=strSQL+data_+"%'";
try
{
HRESULT hTRes;
hTRes = m_pRecordset.CreateInstance(_T("ADODB.Recordset"));
if (SUCCEEDED(hTRes))
{
//----------------------------------------------------
hTRes = m_pRecordset->Open((LPTSTR)strSQL.GetBuffer(130),
_variant_t((IDispatch *)theApp.m_pConnection,true),
adOpenDynamic,adLockPessimistic,adCmdText);
if(!SUCCEEDED(hTRes))
{
AfxMessageBox(_T("Á¬½Ó!³É¹¦!\n"));
}
while(!m_pRecordset->adoEOF)
{
yonghuming = m_pRecordset->GetCollect("̞");
yonghuhao = m_pRecordset->GetCollect("Óû§ºÅ");
daiwei = m_pRecordset->GetCollect("µ¥Î»");
taiquhao = m_pRecordset->GetCollect("̨ÇøºÅ");
taiquming = m_pRecordset->GetCollect("̨ÇøÃû");
benyue = m_pRecordset->GetCollect("±¾ÔÂ");
shangyue = m_pRecordset->GetCollect("ÉÏÔÂ");
dianliang = m_pRecordset->GetCollect("µçÁ¿");
yue = m_pRecordset->GetCollect("Óà¶î");
nI=m_pListCtrl->InsertItem(0xffff,(_bstr_t)yonghuming);
// m_pListCtrl->SetItem(nI,1,1,(_bstr_t)yonghuming,NULL,0,0,0);
m_pListCtrl->SetItem(nI,0,1,(_bstr_t)yonghuhao,NULL,0,0,0);
m_pListCtrl->SetItem(nI,1,1,(_bstr_t)daiwei,NULL,0,0,0);
m_pListCtrl->SetItem(nI,2,1,(_bstr_t)taiquhao,NULL,0,0,0);
m_pListCtrl->SetItem(nI,3,1,(_bstr_t)taiquming,NULL,0,0,0);
m_pListCtrl->SetItem(nI,4,1,(_bstr_t)benyue,NULL,0,0,0);
m_pListCtrl->SetItem(nI,5,1,(_bstr_t)shangyue,NULL,0,0,0);
m_pListCtrl->SetItem(nI,6,1,(_bstr_t)dianliang,NULL,0,0,0);
m_pListCtrl->SetItem(nI,7,1,(_bstr_t)yue,NULL,0,0,0);
// nItem=m_pListCtrl.InsertItem(0xffff,(_bstr_t)vID);
m_pRecordset->MoveNext();
}
}
}
catch(_com_error e)///²¶×½Òì³£
{
CString errormessage;
MessageBox("´´½¨City¼Ç¼¼¯Ê§°Ü!",data_);
}
}
picture:
http://www.codeguru.com/forum/showthread.php?s=&threadid=249394
|
|
|
|
|
chinakknd wrote:
Thank you !!
You are welcome.
please see the picture .
Yes, it's a nice dot. 2x2 pixels on my screen at this viewing resolution. Black.
the rigth button's code is here
And the other button is... left, or wrong?
I'm sorry for being a pest like this, but without you asking a question, not to mention posting code with no reasonable formatting, containing characters in some asian character set (i.e. looking like a broken gfx driver), how are we supposed to help you with your problem?
<mode=blunt, but honest>
I could also be more direct and say "Do your own debugging". If you can't even debug your own SEGVs I think you've either selected the wrong line of work or the wrong programming language.
</mode>
|
|
|
|
|
Mike Nordell wrote:
2x2 pixels on my screen at this viewing resolution.
Cool! At my current screen resolution 1024x768x16 the dot is only 1x2 pixels! What resolution do you use??? ;)
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
|
I guess the problem lies on line:
strSQL="SELECT * FROM Ïêϸ where µ¥Î» like '%" ;
I don't think, that my sql server is able to process it
|
|
|
|
|
I have a neat program. I would love to add some type of
documentation to the program. I tried working with
Help Workshop and I tried reading through articles on
creating and adding HTML help. I am totally stumped
and I spent alot of days trying to get just the basics
to work.
Any ideas on how to create and add simple HTML to an
application???
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
Have a look at www.helpware.net, download far.
I purchased RoboHelp, but all I use now is FrontPage 2002 and Far.
Regards, Keith
|
|
|
|
|
I just got finished creating an HTML help file for an application. When the app is installed, the HTML file gets added in the same directory as the app.
I then added a menu item called 'Help' before About on the main menu. When the user clicks we get use GetCurrentDirectory() to get our directory. Save it as a CString. Then add the html file name to the end of the string. Then use ShellExecute() to open the html file in the default browser.
I actually wanted to add a standard help file, but wasn't allowed. It works though.
void COurProgram::OnCommandsHelp() {
TCHAR szBuffer[MAX_PATH];
GetCurrentDirectory(MAX_PATH, szBuffer);
CString strHelp;
strHelp.Format("%s\\help.html", szBuffer);
SHELLEXECUTEINFO ShExecInfo = { 0 };
ShExecInfo.cbSize = sizeof( SHELLEXECUTEINFO );
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = "open";
ShExecInfo.lpFile = strHelpFile;
ShExecInfo.lpParameters = NULL;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOWMAXIMIZED;
ShExecInfo.hInstApp = NULL;
HINSTANCE h = ShellExecute(NULL, "open", strHelpFile, NULL, NULL, SW_SHOWMAXIMIZED);
if ((UINT)h > 32) {
} else {
}
}
</code>
|
|
|
|
|
hi
how to simple crypt and encrypt string in Visual C++
|
|
|
|
|
A quick, simple, and unreliable way is to XOR the string with another string.
char szSomeString[] = "This is a string\0";
char szXORString[] = "String\0";
char szEncString[ 100 ];
for( i = 0; i < strlen( szSomeString ); i++ )
{
szEncString[ i ] = szSomeString[ i ];
for( j = 0; j < strlen( szXORString ); j++ )
szEncString[ i ] ^= szXORString[ j ];
}
szEncString[ i ] = '\0';
To decrypt it, you repeat the same steps but backwards. However, I would suggest a stronger encrypting algorithm or some hashing functions. For that check MSDN.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
|
Humn... I think I don't have to say that this cipher construction has only 256 possible keys and therefor can be cracked in less than a microsecond
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Dominik Reichl wrote:
Humn... I think I don't have to say that this cipher construction has only 256 possible keys and therefor can be cracked in less than a microsecon
That's why I refered to it as very unreliable . But for someone that has never done any encryption that is a start.
Your brought up a very good point though.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|