Click here to Skip to main content
15,913,944 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CSocket and threads Pin
valikac3-Apr-03 8:16
valikac3-Apr-03 8:16 
GeneralRe: CSocket and threads Pin
Beer3-Apr-03 9:15
Beer3-Apr-03 9:15 
GeneralRe: CSocket and threads Pin
markkuk3-Apr-03 9:49
markkuk3-Apr-03 9:49 
GeneralRe: CSocket and threads Pin
Beer3-Apr-03 13:05
Beer3-Apr-03 13:05 
QuestionHow to scroll down a CEdit control? Pin
IGx893-Apr-03 6:54
IGx893-Apr-03 6:54 
GeneralGet Click from subcontroller Pin
Mathias S.3-Apr-03 6:49
Mathias S.3-Apr-03 6:49 
QuestionActiveX on Dialog breaks DialogBoxParam on Callback? Pin
Dan Thurman3-Apr-03 6:46
Dan Thurman3-Apr-03 6:46 
GeneralNetworking woes... Pin
Navin3-Apr-03 6:23
Navin3-Apr-03 6:23 
I am trying to do something simple. A user types in a share name of a resource (e.g., \\Mycomputer\MyShare), and I want to validate it to make sure the resource actually exists before going any further.

Apparently, nobody else does this, becuase the documentation for all the Microsoft networking APIs sucks, and there are very few examples on the Net (I couldn't find anything relevant). Here are some of the things I've tried to do so far:

resource.dwType = RESOURCETYPE_PRINT;
resource.lpRemoteName = uncShareName.GetBuffer(0);

size = 0;
error = ::WNetGetResourceInformation(&resource, NULL, &size, NULL);


I always get error code 487 - Invalid address. (Of course, MSDN does not list this as an error that WNetGetResourceInformation should return.)

So then, I tried seeing if I could set the NETRESOURCE's lpProvider and perhaps that would make things go smoother. But this simple code:
DWORD size = 1000;
char provider[1000];
DWORD error;

error = ::WNetGetProviderName(WNNC_NET_MSNET, provider, &size);

always returns an error 1222, network cannot be found (network not present or cannot be found). Apparently my network type is wrong, but there are no others that look anywhere near correct.

For printers, I can use EnumPrinters and get it to work - but only if the remote server is Windows NT, 2000, or XP. It gives me an error, RPC Server unavailable, if I try to look for shares on a 9X machine.

One final piece of the puzzle - I know it is not a networking issue, becuase I can see any object I want using Windows Explorer or "Run" from the Start menu.

Any help would be appreciated.


"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
GeneralRe: Networking woes... Pin
Navin3-Apr-03 10:44
Navin3-Apr-03 10:44 
GeneralDisplaying Forms From A Visual Studio Macro Pin
nde_plume3-Apr-03 5:19
nde_plume3-Apr-03 5:19 
GeneralRe: Displaying Forms From A Visual Studio Macro Pin
Alvaro Mendez3-Apr-03 6:11
Alvaro Mendez3-Apr-03 6:11 
GeneralRe: Displaying Forms From A Visual Studio Macro Pin
nde_plume3-Apr-03 6:29
nde_plume3-Apr-03 6:29 
GeneralPrint previewing Word document in Active Document Container Pin
Martyn Pearson3-Apr-03 4:30
Martyn Pearson3-Apr-03 4:30 
General.NET FlatStyle equivilent in MFC Pin
Ceri3-Apr-03 4:23
Ceri3-Apr-03 4:23 
GeneralDestroyWindow() and delete Pin
ns3-Apr-03 4:11
ns3-Apr-03 4:11 
GeneralRe: DestroyWindow() and delete Pin
Ravi Bhavnani3-Apr-03 4:18
professionalRavi Bhavnani3-Apr-03 4:18 
GeneralRe: DestroyWindow() and delete Pin
ns3-Apr-03 4:21
ns3-Apr-03 4:21 
GeneralRe: DestroyWindow() and delete Pin
Ravi Bhavnani3-Apr-03 4:27
professionalRavi Bhavnani3-Apr-03 4:27 
GeneralRe: DestroyWindow() and delete Pin
ns3-Apr-03 4:30
ns3-Apr-03 4:30 
GeneralRe: DestroyWindow() and delete Pin
User 66583-Apr-03 4:36
User 66583-Apr-03 4:36 
GeneralRe: DestroyWindow() and delete Pin
Anonymous3-Apr-03 4:47
Anonymous3-Apr-03 4:47 
GeneralRe: DestroyWindow() and delete Pin
jhwurmbach3-Apr-03 5:16
jhwurmbach3-Apr-03 5:16 
GeneralRe: DestroyWindow() and delete Pin
User 66583-Apr-03 5:46
User 66583-Apr-03 5:46 
GeneralRe: DestroyWindow() and delete Pin
jhwurmbach3-Apr-03 20:02
jhwurmbach3-Apr-03 20:02 
GeneralCTreeCtrl - OnSelChange() Pin
JensB3-Apr-03 3:36
JensB3-Apr-03 3:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.