|
I have tried that, thats when i get the NERR_NetNameNotFound error. should i give the full path of my shared folder or just the share name. It seems logical to use the share name.
|
|
|
|
|
The NetShareGetInfo function retrieves information about a particular shared resource on a server.??To what extent do you want to have the control??.
SO if you need the control of the files/folders/printers that are residing on the other machine use NETRESOURCE structure and pass it to WNetAddConnection2 function. This opens the connection and you can get the control to the shared folders.
Can you tell me what exactly do you want to do because there are a lot of roads that lead to somewhere from here but that would be useless mentioning here if they are of no use to you
Wishes
Anshuman
|
|
|
|
|
I am creating a tool to check the attributes of all the shares on my computer. just my computer. So basically i need to get all the information about the shares on my PC using NetShareGetInfo.
So far i have been trying to get info for one specific share but it keeps saying the the shre does not exist(NERR_NetNameNotFound)
Thanks for the help hey.
Kelvin Chikomo
|
|
|
|
|
kelprinc wrote: So basically i need to get all the information about the shares on my PC using NetShareGetInfo.
Use NetShareEnum(NULL, ...) instead. If you need information about a particular share, use NetShareGetInfo(NULL, _T("NameOfShare"), ...) .
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
Hi
I have an Windows Explorer type MFC SDI Application.
In my application i am doing heavy processing using worker threads so that the main thread donot hangs(during a heavy process) & keeps processing user requests.
Now at the time the heavy process(finding files/folders in logical drive) is executing, the GUI is also being updated via ::SendMessage() function from worker thread to the primary thread.
Following are updated:
--> In tree view folders are added.
--> In List View files are added in Report view.
--> Progress bar status bar pane 0 is updated.
--> Status bar pane 1 is also updated with total of files & folders.
Now my question is:
Q1--> Is the above strategy fine?.
Also while the heavy process is running & the user presses the <stop> toolbar button, the control goes to CMainFrm::OnStop(). From this function a message box is prompted to the user asking whether he wants to stop or not.
Is this display of msg box by the main thread fine while the worker thread is running?.If the user says <yes>, the worker thread is made to return.
I have also read that worker threads must not try to launch any GUI window(message box, dialogs.). But here in my case the msg box is thrown by the main primary thread.
Waiting for suggestions
Best Regards
|
|
|
|
|
dp_76 wrote: Q1--> Is the above strategy fine?
This is the same thing as manipulating GUI objects from a worker thread since a ::SendMessage is issued in both cases. When using ::SendMessage the call will wait for the message to be handled before returning. If the receiving thread does not handle the message you will have a deadlock situation.
Even if you are fortunate and able to avoid a deadlock situation, your worker thread is waiting for the main thread to handle the message and your worker thread is "paused" until the main thread has handled the message. Usually this is not desired.
The use of ::PostMessage is recommended instead which will prevent a deadlock situation and also makes the worker thread continue while the main thread is handling the messages you've posted to it.
Regarding the message box issue the same thing as above is applicable.
If you are using ::SendMessage, the worker thread would be waiting for the call to return and here you may have a deadlock situation if you like to wait for the worker thread to finish by waiting on the thread handle.
The thing is do have a worker thread execute asynchronously as long as it does not use data that is shared between thread. If either thread is using shared data you would need some kind of synchronization object to prevent data corruption, e.g. critical section.
Hope this helps
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
|
Sounds fine. It is fine to display a message box in the worker thread - Although it is better if the UI thread does this as the worker can keep processing until the user makes his choice. Roger has a point when he makes his case for replacing SendMessage with PostMessage .
Steve
|
|
|
|
|
I want to show the thumbnails of html files to the user. As the thml file is of 600*400 I need to show the thumbnails in a list. So how do I convert the HTMl files output(the one which we see when we open the file in browser) into a image like bmp ot JPG
Regards,
Hemant Kulkarni
|
|
|
|
|
I dont really understand your question but from what i understand i suggest you open the Html file then press Print screen on your keyboard. Then open any image editor like MS paint then click paste and save your html file in any format you wish.
Hope this helps
Kelvin Chikomo
|
|
|
|
|
Thanks for reply
But I want to do this convertion programatically. So I need the code or the method to achive this.
Once gain thanks for your reply
Regards,
Hemant kulkarni
|
|
|
|
|
I haven't personally tried any of this but here goes:
1. Use IViewObject::Draw to draw into a HDC that has bitmap selected into it.
2. Didn't Windows used to generate thumbnails of HTML pages? Win98 was it? I believe this functionality still exists.
Steve
|
|
|
|
|
Code project article on it here.
Steve
|
|
|
|
|
|
Another CodeProject article on it here. This was the option 2 I was talking about.
Steve
-- modified at 5:11 Tuesday 17th January, 2006
Link in article is wrong, try this instead.
|
|
|
|
|
Hi Steve,
Thanks a lot for reply. Your code and method seems to be very helpful to me.
Thanks again for rugent reply !.
Regards,
Hemant Kulkarni.
|
|
|
|
|
Sir ,
As i m having the VS c++ 6.0 version where there is not the prototype for the IHtmlElementRender interface in the Mshtml.h file so is there any other way out of this.
Regards
Shikha
|
|
|
|
|
With the SDK that comes with MSVC6 the declaration is not present. In the Feburary 2003 Platform SDK it's present. You need to download a newer Platform SDK from Microsoft. Download from here[^]. You can use this SDK with MSVC6.
Steve
|
|
|
|
|
A more easy task
copy the Web pages to a folder
the select from the view thumbnails
and then use print screen to store the image
this can make ur work fast
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
I'm trying to send mouse message to a application programmatically . I use win32 API SendMessage() to MS Paint (just 4 a test) to draw : SendMessage(hwnd_paint,WM_LBUTTONDOWN,0,position). There was no error but nothing happened. Is there something wrong ?
|
|
|
|
|
1. Manually do the mouse event and using spy++ try to find out the appropriate values of LPARAM and WPARAM
2. After a lbuttondown message, also post a lbutton up message.
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
To fake input you should use the SendInput function. See here for details (talks about keyboard input but a lot of what is mentioned still applies).
Steve
|
|
|
|
|
|
I used Spy++ to get parameter, and try to SendMessage. But it dosent work. I cant understand what happened ????
|
|
|
|
|