|
hi ,
i have made a sever & client in java and a server & client in vc++.both are tranferring data to each other properly.
but when i run java server and connect a vc++ client to it ,client gets connected to server properly but the client does not read tthe data sent by server properly and gives absurd values,instead.
the code for receive in vc++ client:
iReturn = recv (ServerSock, szClientA, sizeof (szClientA), 0);
the code for java server is
output = new ObjectOutputStreamconnection.getOutputStream() ); output.flush();
message = (String) input.readObject();
display.append( "\nhhhhhhhhh" + message );
should i change the output stream in java?
please help me.its really urgent
|
|
|
|
|
I tried to do this—but I can’t figure out what the throw and handle portions should be—please advise—this is my last assignment for the year! As you can tell I need alot of improvement!!
Write a program that prompts the user to enter a length in feet and inches and outputs the equivalent length in centimeters. If the user enters a negative number or a nondigit number, throw and handle an appropriate exception and prompt the user to enter another set of numbers.
#include <iostream>
using namespace std;
// VARIABLE DECLARATIONS:
double inches; // number of inches
double foot; //number of feet
double centimeters; // number of centimeters
int choice; // users menu choice
int main()
{
//give the user some options and begin actual program
do
{ // while choice is not equal to zero
// present menu of options
cout << endl;
cout << " conversion of inches,feet to cetimeters" << endl;
cout << endl;
cout << "1 - Convert inches and feet to centimeters" << endl;
cout << "0 - Quit" << endl;
cout << endl;
cout << "Enter choice : ";
// get users response
cin >> choice;
if (choice == 1) {
// process inches to centimeters
cout << "Enter length in feet: "<<end1;
cin="">> foot;
cout<<"Enter inches as well:"<<end1;
cin="">>inches
cout<
|
|
|
|
|
Does anybody know how to call an executable from a C++ program
|
|
|
|
|
You should browse MSDN on CreateProcess() API function
|
|
|
|
|
here is a good article, hope it helps
www.codeproject.com/system/newbiespawn.asp
|
|
|
|
|
[ShellExecute]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hi all
I have managed to get windows media player (active X control) to play, pause and stop music files. But it only plays a file that is preloaded before running the program.
Is there anyway I can get the player to accept and play a file chosen by the user. I have only suceeded to get the program to show the open file dialog window but it doesnt play the selected file.
Any ideas on how i can get the file to play? Similarly is there a control i can use to load a play list?
I'd be grateful if anyone has any sugestions on this
az
|
|
|
|
|
I'm afraid I don't have the code here, but I've definately played playlists and files from C# using WMP. From memory, you actually get an object that represents the file to play by calling a static load method on the playlist, then you set the current file to be that object.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hiho@ll
anybody knows how to get the server-ip (oder domain name) if i have an HINTERNET handle?
i'm using a CHTTPClient i found at codeproject which uses WinHttp
i connect to a server, which redirects (using the Location response header) to another server
the connection handling of winHttp does everything right, but i just want to know to which server i'm really connected!
i tried HttpQueryInfo
but this uses the Host header field of the http request
and this header field isn't set because of the Location field of the server
so anybody knows a function, which tells me to which server i'm connected using a HINTERNET handle?
thx@ll
|
|
|
|
|
Hi,
is it possible to use Riche Edit Controls for non MFC dialog based apps?
When I insert such a control, I dont see anything. I googled a bit, and found out that I need to call AfxInitRichEdit2. But this one is for MFC based apps. I dont use MFC and I dont want to.
Is there any way to use them? I couldnt find a function to initialize it.
DKT
|
|
|
|
|
LoadLibrary(_T("RICHED32.DLL"));
|
|
|
|
|
Perfect! Thanks alot!
EDIT: How can I auto scroll to the end of the rich edit control?
DKT
|
|
|
|
|
look for [EM_LINESCROLL] message
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I like to write a project about chatting , but i don't know how to begin because i don't have much exprience about it . So can anyone tell me some examples or some code about it ? thks all!!!!!!!!!
|
|
|
|
|
|
I have to read some data from the registry, and will need to use it several times in probably all the parts of my application.
So instead of reading it from the registry every time I need it, I would like to read it once and make it available to all the application parts.
How can I do that? I thought about the Document class but I have more dialogs that can't access this one.
Thanks
|
|
|
|
|
create a registry class with static member variables.
|
|
|
|
|
I was thinking in CWinApp and CDocument, and forgot that I can make my OWN class.
Thanks
|
|
|
|
|
Make the data global. The simplest thing to do is to place it in stdafx.h , marking the declarations with the extern keyword. In the main program, where you retrieve the data from the registry, repeat the declarations without the extern keyword.
Software Zen: delete this;
|
|
|
|
|
Done it with this method in 3 minutes.
Thanks a lot
|
|
|
|
|
You're welcome.
Software Zen: delete this;
|
|
|
|
|
in MFC, why menu commads of a dialog added in normal way can not be sent to their command handlers? why the menu can not be auto-enabled (disabled)?
how to solve the problems?
thx
includeh10
|
|
|
|
|
Hello!
How can I open .col files with hh.exe? I already installed the latest version of HtmlHelp Workshop and tried to run the hhupd.exe, but it tells me that I got a newer version already (I'm using Windows XP SP2).
Do I have to install any update? How to make hh.exe open .col files?
Thanks in advance and best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Hey guys,
Anyone knows about how to dynamically import a class from a dynamically loaded win32 DLL. ( I dont have the .lib file nor the header file for the dll) but i know the names of classes in the dll.
furthermore, can I (using VC++ 6) import classes written in VC# 7.0 as a DLL and use them in my VC++ app?
Need help plz
Regards
|
|
|
|
|
Well it's tricky. What you usually do is define a function that creates and returns a pointer to a class and then a function that destroys the object passed. If you don't have the complete class definition, this is as good as you'll get because you will never be able to create an object yourself. How could you without it's definition? The compiler requires this, even pointers to functions imported from DLLs are defined before they are used. Search www.deja.com for "import classes from DLL dynamically" for more information.
|
|
|
|