|
Hi
Thankyou cmk. I will have a look at it.
Regards
Shiraz
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Hi,
It's here what you need
#include <windows.h>
#include <wincon.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
typedef struct _ASTAT_
{
ADAPTER_STATUS adapt;
NAME_BUFFER NameBuff [30];
}ASTAT, * PASTAT;
ASTAT Adapter;
void main (void)
{
NCB Ncb;
UCHAR uRetCode;
char NetName[50];
LANA_ENUM lenum;
int i;
memset( &Ncb, 0, sizeof(Ncb) );
Ncb.ncb_command = NCBENUM;
Ncb.ncb_buffer = (UCHAR *)&lenum;
Ncb.ncb_length = sizeof(lenum);
uRetCode = Netbios( &Ncb );
printf( "The NCBENUM return code is: 0x%x \n", uRetCode );
for(i=0; i < lenum.length ;i++)
{
memset( &Ncb, 0, sizeof(Ncb) );
Ncb.ncb_command = NCBRESET;
Ncb.ncb_lana_num = lenum.lana[i];
uRetCode = Netbios( &Ncb );
printf( "The NCBRESET on LANA %d return code is: 0x%x \n",
lenum.lana[i], uRetCode );
memset( &Ncb, 0, sizeof (Ncb) );
Ncb.ncb_command = NCBASTAT;
Ncb.ncb_lana_num = lenum.lana[i];
strcpy((char*)Ncb.ncb_callname, "* " );
Ncb.ncb_buffer = (unsigned char *) &Adapter;
Ncb.ncb_length = sizeof(Adapter);
uRetCode = Netbios( &Ncb );
printf( "The NCBASTAT on LANA %d return code is: 0x%x \n",
lenum.lana[i], uRetCode );
if ( uRetCode == 0 )
{
printf( "The Ethernet Number on LANA %d is: %02x%02x%02x%02x%02x%02x\n",
lenum.lana[i],
Adapter.adapt.adapter_address[0],
Adapter.adapt.adapter_address[1],
Adapter.adapt.adapter_address[2],
Adapter.adapt.adapter_address[3],
Adapter.adapt.adapter_address[4],
Adapter.adapt.adapter_address[5]);
}
}
}
Regards
Alpha
|
|
|
|
|
Sorry ,
Link with Netapi32.lib
the include files are missed bcz of HTML tag
they are
#include windows.h
#include wincon.h
#include stdlib.h
#include stdio.h
#include time.h
Regards
Alpha
|
|
|
|
|
Hi all
Thankyou very much.
The above method works for me.!
Regards
Shiraz
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Any time buddy
Keep in touch
Regards
Alpha
|
|
|
|
|
Hello there, please excuse my jumping in, I also have a similar requirement to build a list of MAC's but when I tried to compile your code I received the error "unresolved external symbol _Netbios@4", I'm using Visual Studio 6.0 SP1 under XP Pro SP1 any help much appreciated
Pete Kane
Pete Kane
|
|
|
|
|
I want to List all the shared folders on the computers which are connected in the LAN. We can access the shared folders through UNC naming like \\<computer name="">
I want to find all the computers inside LAN and the shared folders on them programmatically (VC++).
Thaks and Regards,
Shri
|
|
|
|
|
For each server, use NetShareEnum() to get shared resources.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks for your help. By using NetShareEnum() I could find the shared folder on the local PC (server_name = NULL). But when I specify server_name as some other machine on LAN it says "Access is denied"
Could you please suggest me some other way of doing this?
Also I want to list all computer on the LAN. Can you please tell me how to do this? as the above fuction requires server_name and only gives shared folder names on that machine.
Thanks,
Shri
|
|
|
|
|
shri_31 wrote:
But when I specify server_name as some other machine on LAN it says "Access is denied"
Do you have UNICODE and _UNICODE defined? What does you call to NetShareEnum() look like, including the variable types?
shri_31 wrote:
Also I want to list all computer on the LAN. Can you please tell me how to do this?
WNetOpenEnum() followed by WNetEnumResource() . See MSDN for examples.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hello,
What is the best way to make different processes send messages to one another?
I mean, I know how to make different threads within the same process (app) communicate with one another, but I really don't know what is the correct way of making different threads in different processes communicate with each other...
David
|
|
|
|
|
COM - Component Object Model
for more Info, check the articles on this page
regards WoodStock
|
|
|
|
|
Depends on what you are trying to do.
1. If all your processes are on the same machine, and you don't need a lot of data, or the data is of the same format every time, you can use memory mapped files.
2. You can use TCP/IP and sockets to send data back and forth, also works over the network.
3. If it is a TINY amount of infrequent data, with no return recipt required, you could look into MailSlots.
4. Hey, you can even use COM, but what a pain in the backside! (Marshaling data, getting hrreading mdoels and initialization to work right, DCOM settings, etc.)
5. You can use Local RPC (everything running on same computer) or Remote RPC (not necessarily on same computer).
6. WM_COPYDATA - sending data between windows of different processes.
Your question is impossible to answer appropriately without more details.
But you might want to read a little bit about each of the technologies mentioned here, and then you can make your own decision.
|
|
|
|
|
Hi Blake and thanks for the input.
Looking back at you posted, I think I will have to go for the COM solution as I think it is the best one.
Can I ask you one thing though? Do you know of any site(s) with the right technical content I could learn from?
|
|
|
|
|
I use CodeProject and MSDN almost exclusively.
You can post an aritcle request here on CodeProejct, and someone might write a tutorial on COM as it pertains to InterProcess Communications (IPC).
I am sorry that I don't have a recommendation for an excellent COM site. Maybe another user here could come up with some suggestions. Also, try the COM forum on CodeProject (unless you already did...)
|
|
|
|
|
Anyone ever write any app wizards for eVC4? I tried using a awx from VC6 and that didn't work (no real surprise). I can't find much info on how you create them however. Any pointers (links, etc) would be much appreciated!
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Never mind - it helps to look in the Help files a little more - oops
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Hello,
My question is: would it be possible to make a correct screen capture if a video file is playing at that moment ? (not necessarily in full screen)
I saw what are the methods for capturing the screen via d3d but for videos playing the capture consists just in a black square !
Would it be a solution for this?
Thanks.
|
|
|
|
|
hi!
i've written a little template class test app & am having real problems trying to build it. it all compiles fine but i get LNK2019 errors for every method of the template class used in 'main'. i've copied the code & build output below, & would really appreciate ANY help you can give. thanks!!
#ifndef _TEST_H_
#define _TEST_H_
template <class type> class Test
{
public:
void SetMember(type Val);
type GetMember();
Test<type>& Copy();
private:
type m_Member;
};
#endif // _TEST_H_
i've gotta feeling that i've implemented the class methods incorrectly, but really can't see how!?
#include "test.h"
template <class type>
void Test<type>::SetMember(type Val)
{
this->m_Member = Val;
}
template <class type>
type Test<type>::GetMember()
{
return this->m_Member;
}
template <class type>
Test<type>& Test<type>::Copy()
{
return *this;
}
#include <iostream>
#include "test.h"
using namespace std;
int main()
{
Test<int> tst;
cout << "TEMPLATE TEST PROGRAM..." << endl << endl;
tst.SetMember(68);
cout << "TEST CLASS RETURNS\t" << tst.GetMember() << endl;
Test<int> tst2 = tst.Copy();
cout << "TEST CLASS 2 RETURNS\t" << tst2.GetMember() << endl;
cout << "Press any key to end..." << endl;
cin.get();
}
the above code produces the following errors on build...
------ Build started: Project: template_test, Configuration: Debug Win32 ------
Compiling...
test.cpp
Linking...
main.obj : error LNK2019: unresolved external symbol "public: class Test<int> & __thiscall Test<int>::Copy(void)" (?Copy@?$Test@H@@QAEAAV1@XZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: int __thiscall Test<int>::GetMember(void)" (?GetMember@?$Test@H@@QAEHXZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: void __thiscall Test<int>::SetMember(int)" (?SetMember@?$Test@H@@QAEXH@Z) referenced in function _main
Debug/template_test.exe : fatal error LNK1120: 3 unresolved externals
template_test - 4 error(s), 0 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
|
|
|
|
|
Copy all code of test.cpp at the end of test.h , remove test.cpp from project, and you will be done!
ARSALAN MALIK
|
|
|
|
|
thanks!! that works!! why is that?? i thought when a class is used in more than one module (.cpp) you have to implement class methods etc in a separate cpp!? does the compiler do that for you for every specialisation then??
|
|
|
|
|
I remember a person asking the same thing a couple of days ago... The answer can be found here[^]
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Hi everyone, i am in the process of writing a virtual keyboard, i have all the functionality in place, but am unable to pass the keystrokes to an underlying program, eg a new mail message. if anyone has any pointer it would be much appreciated.
|
|
|
|
|
SendInput Function -
The SendInput function synthesizes keystrokes, mouse motions, and button clicks.
|
|
|
|
|
I am using the keybd_event method, and it works ok, but only within my program, if i put a text box within my program then the keystrokes are displayed as expected in the box, i need to be able to pass these key strokes to another program, so if i had say notepad open when i press the keys on my virtual keyboard they appear in notepad ???
Lee
|
|
|
|