|
Having not enough info to say directly. But if you accept your sockets through AcceptEx there is only one way how to get the socket info as the getpeername() doesn't work anymore after AcceptEx .
If this is your case, look at the GetAcceptExSockaddrs function, this is a way how to handle it.
|
|
|
|
|
Well I am using "accept" to make connection. The exact thing that is happening is when I get the port no by(getpeername), I receive junk not the exact port no and the junk value changes whenever the program is restarted. U can have a better idea of it by viewing the code. Plz help me out.
getpeername(ClientSock,
(struct sockaddr *) &accept_sin,
(int *) &accept_sin_len);
short x=accept_sin.sin_port;
m_port=x;
UpdateData(false);
MessageBox (x, TEXT("family"), MB_OK);
Reply me soon
|
|
|
|
|
Don't know if this is exact solution for your problem - problem is that in TCP/IP the numbers are in network byte order - this is OK for some big machines, but for Intel you have to switch the order (this is the Little/Big endian problem).
so the code should looks like:
<br />
getpeername( ClientSock, (sockaddr*)&accept_sin, (int*)&accept_sin_len);<br />
<br />
short port = ntohs( accept_sin.sin_port );<br />
...<br />
the same will be later on for the address...
|
|
|
|
|
hi all,
i want to use the version number system
major.minor.patch.build
for my software.
Should i reset the build count to 0 (zero) if i increment the minor or major version ? Or should i just keep the build number as it is ?
I know there are no strict rules. But.. just to be professional...
thanks in advance
Hari Krishnan
|
|
|
|
|
I usually use the date as my build number.
i.e.: v2.1.1.20030115
or you can be crazy and encode the date in hex: v2.1.1.131A2A3
I usually only embed the build info into the help-->About box.
On a major release, I will reset the minor and patch numbers though
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
There are many methods to redraw a window, like Invalidate , UpdateWindow , RedrawWindow ...
Can anyone explain me when to use every method and what they are doing?
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
UpdateWindow is for window's creation.
Invalidate is asyncronized.
RedrawWindow is syncronized.
includeh10
|
|
|
|
|
Hi all,
I try to use 'DeviceCapabilities' to get supported paper sizes...
Could you please help me to understand how to use 'DeviceCapabilities'
with DC_PAPERNAMES parameter...thank !
|
|
|
|
|
Hi all, I am writing a Backup program in which I want to be able to save files to the rewriteable CDROM drive on another computer. I am intending to use the MS application Direct Cable Connection but don't know how to gain access to the remote drives from within my program. Presumably, the operating system on the local system can "see" the remote drives with a specific pathname that I should be able to use with the CopyFile function. Can anyone enlighten me as to what this is, or failing that, a method to interface to the DCC program from within my program. Thanks !
Doug
|
|
|
|
|
DougButtimer wrote:
I want to be able to save files to the rewriteable CDROM drive on another computer
No matter if it's local or remote, CD-R/W need packet writing on the UDF filesystem.
I think there is now a Linux UDF driver you could peek at to see how the UDF filesystem works. Then you'd need to know how packet writing works, and learn SPTI to actually use it...
If you do it for a remote computer, you'd in addition most probably have to write your own network protocol and service.
++luck; // I think you might need it
|
|
|
|
|
Hi Mike,
Many thanks for your reply. Correct me if I'm wrong, but, as the CD's will always be formatted for direct R/W (i.e. will accept Explorer drag-and-drop operation), the actual mechanics of file-writing on the CDROM drive is not the issue, surely. I "assume" that I will be able to use the CopyFile() function if I can find out what the filepath (via DCC) of the remote CDROM drive is. Alternatively, if I knew how to emulate a drag-an-drop operation programatically within my program on the local computer's DCC window of the remote computer's sharable drive icons (I can do this manually !) then this would solve my problem. Any advice on either of these approaches would be greatly appreciated.
Doug
|
|
|
|
|
DougButtimer wrote:
Correct me if I'm wrong, but, as the CD's will always be formatted for direct R/W (i.e. will accept Explorer drag-and-drop operation), the actual mechanics of file-writing on the CDROM drive is not the issue, surely.
That means you already have an R/W UDF driver and packet writer on the machine handling the CD-R/W.
You however only mention Explorer operations. What happens if you try to copy a file from a CMD.EXE shell (still only locally on the machine that has the CD-R/W) to that CD-R/W disk - does that work? If it does, then you're in a better seat to make the whole idea work. If not, you'd be back to (almost) square one I think.
If it doesn't work, I wouldn't be too surprised if that stuff is implemented by this particular vendor as an Explorer shell extension... You judge how easy and/or "fun" it would be to try to interact with it.
I "assume" that I will be able to use the CopyFile() function if I can find out what the filepath (via DCC) of the remote CDROM drive is.
I seem to recall that "assumption is the mother of all fsck-ups". This often is even more true when dealing with Microsoft APIs and other creations.
|
|
|
|
|
Hi Mike, I can confirm that in a DOS window I can copy files to the CDROM drive. As I've said before, my main issue is with interacting programmatically with the DCC window on the desktop which contains the remote drive icons. Do you know the details of how I can do this ? Thanks for your help.
Doug
|
|
|
|
|
hi there,
can anyone help me out..please..
I have a DLL which i can make package..ex. setup.exe. but i don't know how to register the DLL once i have created the package. it just installs the dll and does nothing. I want DLL to be fully functional when user runs the setup.
plzzzzzzzz help me out...
Himanshu
|
|
|
|
|
run after the copy of the dll
regsvr32 /s "dllnameandpath.dll"
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
i know that ow to register a dll. i want this feature automatic. ok letme explain this again.
I have a dll suppose my.dll which performs a specific function. I want this DLL as a package so that i can distribute it to different clients.
I can make the package but the problem is that i don't want them to run regsvr32 to register the dll. I want this during the setup time.
i hope now my problem is clear..
awaiting replies..any ideas are appreciated.
thanks in advance..
cheers.
Himanshu
|
|
|
|
|
You have several options
1. Microsoft MSI
a. Use VC7 to create setup
b. Use InstallShield to create MSI installation
c. use Wize to create MSI installation
2. Create CAB file
a. Use VC7 to create setup
b. Use InstallShield to create CAB File(I am not sure new IS supports it)
c. use Wize to create CAB installation
3. Use WinZip self extracting capabilities
4. create .bat file
The keywords to search on MSDN : MSI, CAB, install
The keywords to search on Internet : Installshield, Wize, WinZip
|
|
|
|
|
Alex gave you great alternatives, but it boils down to this: your setup program should give you the option to automatically register COM DLLs once they're installed. If it's your own home-grown setup program, then can either execute regsvr32 or load the DLL and then call its DllRegisterServer procedure.
Regards,
Alvaro
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
|
|
|
|
|
hy, i have read a lot about this topic, but didnt found good answers. can anybody explain, how i can code the following VB-code in VC++ ?
Sub DocumentsExample()
MsgBox(DTE.Documents.Count)
End Sub
How can i get this DTE object? the compiler doesent recognises it.
I would like to make an addin for VC++.NET in which i can manipulate the code. (textmanipulations)
can anybody tell me, how i can do this? i dont know how to do things which i coud do in VB with
activedocument.selection , etc..
thanx for any input!!!
|
|
|
|
|
can't understand what ur looking for..but what i can make out is you want to messgae something on the screen.. for that u just have to write
MessageBox(CString);
or MessageBox("string");
so you need to convert whatever you want to display into string first then you can display anything.
hope you can slove it now..
cheers..
Himanshu
|
|
|
|
|
hy, thanx for the answer.
unfotunately, its not what im looking for.
1. MessageBox("string"); gives a compiler error,
only : MessageBox(NULL, _T("Hello From C++"), _T(""), MB_OK) is ok.
2. i wonder how to use the DTE object. in the MSDN library the example code is all in VB!
3. remember, i try to program an add-in !
|
|
|
|
|
It would help if we knew what this DTE object is. More importantly, search for the type-library. Once you find it, you can use the Class Wizard/Automation tab to add a wrapper class for it which you can then use in your code.
Regards,
Alvaro
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
|
|
|
|
|
Hello,
1. I need to monitor that the user has entered values that are in range.
2. There is only one editControl that is used in order to enter values for 4 different things.
3. The DDV that I've placed is equal thatn the normal one but I've changed the maximinum allowed value to a variable in order to make it more flexible and capable to adapt to each maximum value.
This is what I've done:
DDX_Text(pDX, IDC_ED_POSICIO_DESTI, m_veddPosicioDesti);
DDV_MinMaxDouble(pDX, m_veddPosicioDesti, 0., this->m_EixSeleccionat.m_MovimentEixDirecte.m_dPosicioMaximaPermesa);
but the problem is that when I enter the Class wizard (Ctrl+W) I receive this message:
Parsing error: Expected ")".<br />
Input Line: "DDV_MinMaxDouble(pDX, m_veddPosicioDesti, 0., this->m_EixSeleccionat.m_MovimentEixDirecte.m_dPosicioMaximaPermesa);"
What can I do in order to avoid that message?
Thank you in advance.
|
|
|
|
|
your getting theproblem because you place the DDX_... command within the //AFX_DATA comment blocks. These are the lines that class-wizard will parse during the load phase. If you move the line outside of the comment block, then class-wizard will be happy.
|
|
|
|
|