|
Have you tried NetServerEnum() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Yes Sir I also tried it NetServerEnum() but it is not listing ip of windows or linux machine in lan .
|
|
|
|
|
ashish8patil wrote: ...but it is not listing ip...
It's not supposed to. Use gethostbyname() for that.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hello Sir ,
Thank You Sir it is working. But can i find linux machine in network.
|
|
|
|
|
Are you asking how to know if a machine is Linux based on its name or IP address?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
If both are but consider then fine .
But my question was let :- I am my network 8 machine 3 are are windows and 5 are Linux as i make code by using api you given i am able to fine windows machine only not linux .now i want linux also .
Thanks for your Replay and solution.
|
|
|
|
|
ashish8patil wrote: ...my network 8 machine 3 are are windows and 5 are Linux...
Can you see those 5 Linux machines using Windows Explorer (Network Neighborhood)?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
Hi,
im trying to create a key along with value under registry as follows....
LPCTSTR data=_T("HKEY_CURRENT_USER\\Software\\Siemens\\Tester\\Test");
CRegKey::SetKeyValue(data,_T("sample"),_T("SampleTest"));
The above gives error like....
error C2352: 'ATL::CRegKey::SetKeyValue' : illegal call of non-static member function...
pls help me out...
|
|
|
|
|
Of course your code is like this
CRegKey p;
p.SetKeyValue(data,_T("sample"),_T("SampleTest"));?right
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I suppose he has to open the key before writing to it.
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]
|
|
|
|
|
Well, the message is clear: you need an object, instance of the CRegKey class, and call its SetKeyValue method.
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]
|
|
|
|
|
Thanks for ur reply...
Ya tried what u have suggested the issue i need to create Tester\\Test key under HKEY_CURRENT_USER\\Software\\Siemens and SampleTest(key value) under Test key...and when i tried the above function im getting Abort Message Box...i think this function creates value only under existing keys....
Please correct me if im wrong...
|
|
|
|
|
CRegKey 's Create method looks promising...
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]
|
|
|
|
|
Hai!
When we develop an application in visual C++, we can verify the code by debugging, by keeping break points etc..
Now i am developing an application in embedded VC++ for a WIN CE 5.0 OS Pocket PC Device. My application uses WINSCARD library for supporting PCSC functions, why i mentioned above library is that now i cannot use Pocket PC 2003 emulator. In order to check my application i am always building the .exe , taking the .exe to the pockect PC device and running it, Now even if there is a logical mistake it takes huge time to find it .
Because i am not able to debug my code.
So is there any way so that i can debug the code in my XP operating system itself, keep break points, check the code flow etc. what i need is the application must run on the WINCE device connected to my system, but it must virtually run in my XP system ( NOTE: I cannot use emulator)
Thanks!
|
|
|
|
|
Yes it is possible: you need to have your PocketPC connected to your desktop. Then when you can simply press F5. The debugger will try to connect your PocketPC and copy the file on the PocketPC.
The big problem is that it is extremly slow, that's the reason why it is always easier to debug through the emulator.
|
|
|
|
|
Yes,
When I am pressing F5 the code is building and a status bar is comming stating "connecting to device" and then after some time i get an error message that "Timed out".
How to solve above problem ?
Assuming the device has been connected, Even if it is slow no problem, Can i debug the code from my desktop PC, can i keep break points.. etc.
Thanks!
|
|
|
|
|
Do you have ActiveSync installed ? It's been a long time I didn't do that but if I remember correctly, everything was working fine for me.
Which version of Visual Studio are you using ?
|
|
|
|
|
I am developing my application in eMbedded Visual C++ 4.0 and installed MICROSOFT ACTIVESYNC 4.5.
By the way my WIN CE device has a COM port wire and a USB wire which one shall i have to connect to my Desktop PC
I tried by connecting both of them , and then i got the "Timed out error message!!
Thanks!
|
|
|
|
|
Hi,
I have created MFC application.I am having 2 Dialog boxes.If I click "Add" button(push button) on first Dialog second dialog will open.After canceling of second dialog once again focus is coming on Add Button.At that time I need to refresh my list box,which is on first dialog.
I need to get focus of Add button.So I have created small program like this
BEGIN_MESSAGE_MAP(CMyThreadDlg, CDialog)
ON_BN_SETFOCUS(IDC_BUTTON2, &CMyThreadDlg::OnBnSetfocusButton2)
END_MESSAGE_MAP()
void CMyThreadDlg::OnBnSetfocusButton2()
{
MessageBox(_T("Focus"));
}
If I click on that button focus is coming but function is not calling.Can anyone help me.
|
|
|
|
|
Why do you need to refresh your listbox when your add button gets focus? I am just guessing but i believe what you want is to refresh your list when your second dialog is closed. If it is a modal dialog then all you need to do is refresh your list after your second dialog's DoModal returns.
void CMyThreadDlg::OnPressedAddButton()
{
CMySecondDialog Dlg(this);
Dlg.DoModal();
RefreshMyListNow();
}
If you insist on the focus change maybe try using ON_BN_SETFOCUS(IDC_BUTTON2, OnBnSetfocusButton2) instead of ON_BN_SETFOCUS(IDC_BUTTON2, &CMyThreadDlg::OnBnSetfocusButton2) , does that help?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
Thanks for your reply.I am calling refresh function after second dialog returns.
My code is working fine.
|
|
|
|
|
Hi,
i have a function which takes a parameter as LPCTSTR ie...
f1(LPCTSTR str)
{
ShellExecute(NULL, "open",str,NULL,NULL, SW_SHOWNORMAL)
}
The above function gives error like...
error C2664: 'ShellExecuteW' : cannot convert parameter 2 from 'const char [5]' to 'LPCWSTR'
pls help me out..
|
|
|
|
|
Use
ShellExecute(NULL, _T("open"),str,NULL,NULL, SW_SHOWNORMAL)<br /> instead. I suggest you take a look at this article[^] to get a better understanding about strings manipulation and UNICODE (this explains why you have the error).
|
|
|
|
|
the given answer is correct.
But for the future you really need to understand the difference between these string types. LPCTSTR is a macro which resolves in ANSI in 1-byte chars BUT in UNICODE in 2-byte chars. At best you take a look at the byte layout in debugger.
If you dont consider this in your work you will have a lot of annoying bugs.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|