|
Are there samples for programmatically Sharing
Directories Creating and Creating new Users in Windows ?
How to do it better - using
ADSI, LDAP, or NETapi ?
Thanks you.
|
|
|
|
|
vgrigor1 wrote:
Are there samples for programmatically Sharing
Directories...
Do you mean NetShareAdd() ?
vgrigor1 wrote:
...and Creating new Users in Windows ?
How about NetUserAdd() ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks you,
I only begin to know this methods from NetApi.
But I need to use WMI instrumentation,
so I think WMI- to ADSI methods.
Can you help with useful sample and articles
for WMI and ADSI.
Best ones in MSDN(but I also read, or else.
Thanks you.
|
|
|
|
|
vgrigor1 wrote:
Can you help with useful sample and articles
for WMI...
Which WMI class(es) are you interested in?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Any C++ sdamples.
= common working methods.
Better about ADSI and user management.
|
|
|
|
|
vgrigor1 wrote:
Any C++ sdamples.
Are you wanting C++ samples that show how to use NetShareAdd() and NetUserAdd() ?
vgrigor1 wrote:
= common working methods.
Common to whom?
vgrigor1 wrote:
Better about ADSI and user management.
This makes no sense.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I want C++ samples for WMI with ADSI extensions:
to share directory and add user.
IT is good to get sample for this on other languages,
but for WMI technology.
read this more:
WMI sample WMI sample WMI sample WMI sample
|
|
|
|
|
vgrigor1 wrote:
I want C++ samples for WMI with ADSI extensions:
to share directory...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_share.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/create_method_in_class_win32_share.asp
vgrigor1 wrote:
...and add user.
The Win32_Account class and the Win32_UserAccount class do not have any "create" methods:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_account.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_useraccount.asp
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
We have a node network that I want to autogenerate a layout for. Does anyone know of any libraries or other source for such things?
|
|
|
|
|
Bikram Singh,by using WM_NCACTIVATE as you tell me,my program seems to be OK,but it seems to be a visual effect.My target(Windows Media Player) still loses focus when I click a button on my dialog.
Please tell me more about this.
|
|
|
|
|
Why not save the hwnd of the media player?
This way, when u press a button in your app, u can, before sending keystrokes, make the Media player window focused by using SetFocus()
Bikram Singh
|
|
|
|
|
how can I make the windows taskbar dissapear and then make it appear again.
And please tell me if you know how can I make the start button dissapear and then appear again
Thank you
gabby
|
|
|
|
|
|
how can I get the mail server and port of a certain host.
I know there is a way but I don't k now how I can do this
Please help.
gabby
|
|
|
|
|
lookup the MX records in DNS. If this isn't what you want you have to ask the user in general. You will have to search a little more to find out how to do this (and if this really gets what you want)
|
|
|
|
|
Hi!
I have an object which is a container for one or more other objects. I want to serialize my container to disk and serialize the contained objects along with it.
This is what I have:
class CBook;
class CSubject
{
public:
CSubject(){}
~CSubject(){}
protected:
CList <CBook, CBook> m_Books
};
Can someone tell me the best way of doing this?
Must I want to make my CSubject and CBook classes inherit from CObject and then write a serialisation function for each?
Should I just write all my CBooks and index them to the CSubject or is there a proper way to serialize a CSubject object which then will serialize all the CBook objects contained by the CSubject object. Must I want to store pointers to the CBook objects in my list or do I store objects? I think it must be the objects.
|
|
|
|
|
Inherit CBook from CObject. Then create a similar Serialize(..) function for your CSubject. Call m_oBooks.Serialize(...) in it. If you have pointers in CBook class, i think you need to implement an override for CBook::Serialize(...) too.
<font=arial>Weiye Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
OK but I have one or more CSubject objects and I wish to serialize them all to disk.
So I have a data file which is called library.dat and I want to serialize to this file all my CSubject objects with all the CBook objects each CSubject object contains.
Is this something that CObject will do for me if all my object data members are simple?
|
|
|
|
|
Anonymous wrote:
OK but I have one or more CSubject objects and I wish to serialize them all to disk.
Method 1
- Inherit your CSubject from CObject
- Put all your CSubject objects into an array like CObArray
- To save them, call m_oMyObArray.Serialize(...)
Method 2
Assume you have implemented a save function of your CSubject as below:
void CSubject::Save(CArchive& ar)
{
m_Books.Serialize(ar);
} Just call Save(...) for each of your CSubject objects, passing in your CArchive object. For example,
void SomeFunction()
{
CFile oFile;
if(oFile.Open("C:\\library.dat", CFile::modeCreate | CFile:modeWrite) != FALSE)
{
CArchive oArchive(&oFile, CArchive::store);
oMySubject1.Save(oArchive);
oMySubject2.Save(oArchive);
oMySubject3.Save(oArchive);
oArchive.Close();
}
}
Anonymous wrote:
Is this something that CObject will do for me if all my object data members are simple?
You need to override Serialize for your CBook class. e.g.
void CBook::Serialize(CArchive& oArchive)
{
if(oArchive.IsStoring() != FALSE)
oArchive << m_iMyInteger << m_dMyDouble;
else
oArchive >> m_iMyInteger >> m_dMyDouble;
}
<font=arial>Weiye Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
Thank you! I will try to do what you have suggested. I think I understand now
|
|
|
|
|
Dear guys,
Some MFC program runs well.
Someone uses the task manager(by cntl + alt + del) and selects my mfc.
And than, kill my program.
Can I protect my process from the task manager's kill signal?
Additionaly, i don't wanna use the windows's service mechanism(a.k.a daemon)
Thanks,
|
|
|
|
|
nop
protective philosophy...
TOXCCT >>> GEII power
|
|
|
|
|
I think there is a way you can do it but you will need windows hooks.
The cbtroc call back function monitorises when windows are destroyed and get the handle,module filename.
Read More about this in my article about the simple fireawall. There I explain more about windows process hooks.
If you can't handle please contact.
gabby
|
|
|
|
|
SIG_KILL (or another name like that) cannot be catch. this is to prevent any restive process to stay in memory wastefully.
TOXCCT >>> GEII power
|
|
|
|
|
If this was possible, no rogue process could ever be killed. We'd have viruses running rampant!
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|