|
There is no particular requirement on the Win32 socket connection, if in the other side there is a CSocket .
So just have a look at the documentation [^].
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]
|
|
|
|
|
Sure. A socket is totally ignorant of what language dll is on top of it.
You could connect one end in VB to another in Java.
Morality is indistinguishable from social proscription
|
|
|
|
|
thangvel wrote: can we connect win32 socket in client side with CSocket class in server side
Yes you we can.
thangvel wrote:
if u give answer with sample code means i will be more happy
I would not use the class CSocket instead use CAsyncSocket or something else. Have a look at Beej's guide to networking programming[^] and Winsock Programmer's FAQ[^], there are client/server examples in section 6. You can download, modify it and play with it.
Hope it helps!
/M
|
|
|
|
|
To get disk number for any drive i open drive (like \\.\c and pass its handle with IOCTL_STORAGE_GET_DEVICE_NUMBER in DeviceIoControl and get data in STORAGE_DEVICE_NUMBER structure. This structure returns the device number and partition number.
This works perfectly on basic disk but when i use the same on dynamic disk then it's fail.
Please suggest how to get disk number and partition number for dynamic disk.
|
|
|
|
|
u can try with this IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS structure.
it gives pratition number.
like this,
VOLUME_DISK_EXTENTS pdg;
....
DeviceIoControl(...,IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,...);
....
pdg.Extents->DiskNumber;
thats it.
Regards,
Srinivas
|
|
|
|
|
Thanks
After using that i get correct disk number. But i found starting offset and extent length different.It shows very large value for starting offset.And extent length shows a value(0x7e00) which is the position in disk from where this partition start.
Does extentlength means total size of drive or position of drive in disk?
typedef struct _DISK_EXTENT {
DWORD DiskNumber;
LARGE_INTEGER StartingOffset;
LARGE_INTEGER ExtentLength;
} DISK_EXTENT, *PDISK_EXTENT;
typedef struct _VOLUME_DISK_EXTENTS {
DWORD NumberOfDiskExtents;
DISK_EXTENT Extents[1];
} VOLUME_DISK_EXTENTS, *PVOLUME_DISK_EXTENTS;
|
|
|
|
|
u can get size of disk like this,
ULONGLONG ulLength = pdg.Extents->ExtentLength.QuadPart;
Regards,
Srinivas
|
|
|
|
|
I have two doubts regarding ur question
1. If DeviceIoControl API is failing, can you check error with GetLastError API([^]).
2. What type of dynamic device you are using and hope it comes in one of the define type([^])
Величие не Бога может быть недооценена.
|
|
|
|
|
Hi all,
I have made a simple Dialog box application, in that i have made a static text control with Client Edge properties true and i also have a picture control which has a bitmap. That picture control is below that static control to give a look that bitmap inside that static control border. but the problem is sometimes that bitmap is not displayed i have also used Invalidate(False) everytime i have displayed both the controls but sometimes only static box is displayed and picture is not displayed...
How can i show it..
thanks in advance
|
|
|
|
|
May be you have to properly set the tab order. You can press Ctrl + D on resource view of dialog and see/modify tab order.
|
|
|
|
|
Static control tab should be first or picture control tab
|
|
|
|
|
I think static control should come before the picture box in tab order. I mean if static control's tab order is 1 then picture control's has to be 2.
|
|
|
|
|
still not visible sometimes....
|
|
|
|
|
Have a look at this: Overlapping Controls Are Not Supported by Windows[^] (means siblings). If you want overlapping controls in a dialog use a child-parent-hierarchy, for example use SetParent()[^]. Another alternative would be modifying the static text control you mentioned, make it a custom control that draws a picture in the background.
Hope this helps.
|
|
|
|
|
How do you hide the picture box? Are you using ShowWindow() for that?
|
|
|
|
|
In addition to what Moak mentioned, another thing I would suggest (as an easy workaround) is to remove the static control and enable Client Edge style for picture box.
|
|
|
|
|
When I first heard about Embedded360 and their Fast Embedded Model, I didn’t give much importance to it. But it’s when I worked with them and got to know their work process that I truly understood their approach. Their Agile methodologies combined with technical expertise in the embedded space have helped them in developing flexible, easily accessible, and futuristic solutions that enhance quality and maximize profits. For more details click here: http://www.embedded360.com/[^]
|
|
|
|
|
...
If you're advertising something, pay for it and do it the right way.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
i m creating win32 dll in vc++(mfc) application.i have to call dll function from another dll.
But i dont no the way,how to calling dll function from another dll.
Please help me.
Thanks in advance.
|
|
|
|
|
You could use the .lib file and header (the easier way).
Or you could use LoadLibrary()[^] and GetProcAddress()[^]
There are many beginner level tutorials on DLLs at CP. Just search for those and give some of them a read.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
For that purpose, you can either rely on static linking or dynamic linking.
1. Static Linking
a. Add the lib corresponding to the DLL(DLL that is to be called) in Project Settings->Link->Input->Object/library modules.
b. Add the Include file pf the DLL into your project dsp.
c. Call the function after including the header.
2. Dynamic linking- Usually done in case, where you have Def([^]) files, which is mentioned in the above comment by rajesh.
Величие не Бога может быть недооценена.
modified on Friday, February 5, 2010 6:11 AM
|
|
|
|
|
Pay attention to Rajeshs post, LoadLibrary Getprocaddress are great functions to learn to use.
You get a smaller loaded image by using dynamic linking dont forget!
Morality is indistinguishable from social proscription
|
|
|
|
|
Dude, you've picked on a univoter.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
I have a tree with some nodes with CheckBox enable
I want to disable few of them because they are compulsory to choose so I want few nodes will be selected and disable so user can not change it.
I searched on net and found method CTreeCtrl::setItemState(...) but it does not have option for disabling a node in xp. Below extended method can do this but it is available in VISTA and later.
http://msdn.microsoft.com/en-us/library/bb385266.aspx
m_treeCtrl.SetItemStateEx( hPA, TVIS_EX_DISABLED );
Please suggest some way..
|
|
|
|
|
Hi all,
I m working on Server - Client type application,using SOCKET to communicate between Server and Client.
I m using RegConnectRegistry to access client registry,but some times this function fails.
please help me for this.
i think its a client server connectivity issue because of security hierarchy.
it happens when server is 2003 and client is VISTA with uac enabled.
or Server is 2008 and client is XP.
please help me.
and please tell me how can use user name and password from server side to access the client.
provide me any help or guidance for this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|