|
How can I make my computer a SERVER and have other computers connected to the INTERNET as client? My computer is a part of a LAN which connects to the internet through a gateway.
Ranjan
|
|
|
|
|
Hi Dear
Socket progamming is so nice, you can use CSocket & CAsyncSocket.
you can find meny sample in
Here]
Iman Ghasrfakhri
|
|
|
|
|
Is your computer behind a firewall? If so can you open some ports? Does it have a static address? Is this a private address (192.168.X.X, 172.16.X.X, 10.X.X.X)?
John
|
|
|
|
|
Hi all,
I've got the following problem:
I try to write an application which should use a specific function that
is available in a DLL.
Since I only need one of the various DLL functions and it is neccessary
to create an EXE file as small as possible I thought about not binding
the according LIB file into the project and loading the DLL at runtime.
My problem is, that I can identify the function name within the DLL
(by using DependencyWalker), but I don't know the function parameters
(type and order) I have to use. I also don't know the type of the
return value...
Is there any possibility (some kind of utility prog or so...) to get some
information about the parameters to use???
Many thanks in advance!
Reinhard
|
|
|
|
|
it was my problem some month ago , I can't find any answer
Iman Ghasrfakhri
|
|
|
|
|
reinhard_jd wrote:
My problem is, that I can identify the function name within the DLL
(by using DependencyWalker), but I don't know the function parameters
(type and order) I have to use. I also don't know the type of the
return value...
What exactly are you trying to do? Why do you want/need to call a function but you don't know about its parameters and return type? Even if you get the type and order of parameters, what values will you use? Even if you get the type of the return, what will you do with the returned value?
reinhard_jd wrote:
Since I only need one of the various DLL functions and it is neccessary
to create an EXE file as small as possible I thought about not binding
the according LIB file into the project and loading the DLL at runtime.
So you have a lib for that DLL? Even if you used it instead of loading the DLL yourself, you'd still need some header file with the function prototype, or at least the information to declare the prototype yourself... You have the lib but not the header files?
What's the DLL and what's the function? I really don't undertand your scenario... Or is this some kind of homework assignment?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hi jlr,
I thought that the short version of the story (i.e. the description of the actual problem)
would do it, but here we go with the whole story...
Years ago we developed a software which read some digital and analog values by using a special
I/O card, analyzed the data and depending on the results of this reacted with screen and I/O outputs.
We sold some dozen of the units (hardware and software) and still do service and further development
for the solution.
The card as well as the library (and the DLL) to read/write the ports were manufactured by a small
German firm that doesn't exist anymore. Now we have do do some changes within the software and
unfortunately it seems as if the (packed) EXE file becomes to large to fit onto a floppy disk.
Since the machines we sold at that time didn't have a CD-ROM drive I thougth about how to create
a smaller file...
I don't have the source files of the driver/library and I also have no DEF file of the DLL.
The only thing I have are some LIB files (for the different memory models), the DLL and a
written documentation.
I tried to call the DLL functions directly with the very same parameters as I have to use when
using the LIB, but that didn't work.
Therefore I search for a possibility to find out the type and order of the parameters I have
to use when calling the DLL functions at runtime...
Hope s/o can help me.
Thanks and Greetings from Germany
Reinhard
|
|
|
|
|
Ah, Ok. I was curious and couldn't understand your situation.
reinhard_jd wrote:
I tried to call the DLL functions directly with the very same parameters as I have to use when
using the LIB, but that didn't work.
Unless the lib had something more than a simple stub for the function in the DLL, that should have worked. How did you declare the function type? Perhaps you had a problem with the calling convention (i.e., cdecl Vs. pascal)? That affects the order in which the parameters are put in the stack before calling the function, and if I remember well, also which end of the call is responsible for removing the parameters from the stack. Maybe specifiying the correct calling convention is all that you need.
For C++ functions, Dependency Walker can show you all the parameters and return type of each function if you press F10 or right-click and select "Undecorate C++ functions". However, that's not an option for C functions, which I suspect is what you have.
reinhard_jd wrote:
Thanks and Greetings from Germany
Appreciated and returned from Uruguay,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hi jlr,
I've already tried both calling conventions. I suppose they did something more than only
calling the DLL function from within the LIB file
Undecorating the C++ functions also didn't help...
I hoped that there could be some way I didn't hear of until now to find out the parameters,
but it seems as if there is nothing to do the trick.
At the moment a colleague of mine is trying to find out who (in person) was the original
creator of the library. Perhaps we can find it out by this way.
Once again thanks!
Reinhard
|
|
|
|
|
how can i send values in url
only not in GET method like it set by defult
in need to send it in POST method
|
|
|
|
|
|
|
static const char str[3] = {'a','b','c'};
static const char str[3] = "abc";
what is the difference between the above two? or are they same? is the first one null terminated? why do some folks use the first one when the second one is easier.
|
|
|
|
|
I think the second is null terminated.
I used something similar to the first, but I specified the characters in hexidecimal form like this:
static const char cmd[3] = { 0x0A, 0x10, 0x0D };
I had to use characters not easily expressible on a regular Qwerty keyboard and I also used only characters 2 and 3 sometimes. Character arrays were convenient because the serial port sends 1 byte at a time and characters are 1 byte long.
|
|
|
|
|
The first one is an array of three characters and it is not 0 terminated.
The second one won't even compile.
The static const char str[4] = "abc" will compile - "abc" is 0 terminated thus the array has 4 members.
|
|
|
|
|
I think that most people do this :
static const char *str = "abc";
|
|
|
|
|
I have an SDI application, and I'm operating in the OnPaint handler for WM_PAINT messages in my CChildView derived from CWnd. In the CChildView class, I have 2 pointers to class objects I made derived from CObList which are initialized to NULL when the view is constructed. When I open the file, data is read in and one or both lists may be filled with items. Here is some example code:
void CChildView::OnPaint() {<br />
CPaintDC dc(this);
if (files != NULL {<br />
char * lpszText = new char[32];<br />
sprintf (lpszText, "Files: %u", files->GetCount());<br />
int nTextHeight = dc.DrawText(lpszText, -1, CRect(10, 30, 100, 100), DT_LEFT | DT_SINGLELINE);<br />
MessageBox(_T("files detected"), NULL, MB_OK);<br />
delete[] lpszText;<br />
} else { dc.DrawText(_T("Files: 0"), CRect(10, 30, 100, 100), DT_LEFT); }<br />
}
Now, what happens is when I start the app, I am told there are no files which is right. When I open the file, the code runs through and I see the MessageBox displayed but the text that should have been drawn in the line above it doesn't show up on the screen. However, if I were to put a breakpoint on the sprintf line, start the program, load a file, it would break on the line and I were to press F5 to continue executing, the result of DrawText would show up on the screen fine and the message box would pop up too.
I've tried to see if I'm doing something wrong or if I'm not doing something I should here and on other GDI tutorial sites but I can't figure out why this behavior exists. Can someone please set me straight?
|
|
|
|
|
If you need solution of problem, use CDC* pDC = GetDC(); instead of CPaintDC dc(this);
|
|
|
|
|
I was reading about GDI and I believe that's the old way and I figured using CPaintDC was used for a reason. I'll check it out, thanks for the tip.
|
|
|
|
|
The problem is that the area in which you are drawing is not 'invalidated'. Breaking into the debugger has the side-effect of invalidating the entire window and that's why it works fine after that. Whenever you change the info, which by the way should be in your document instead of your view, you need to make the view invalidate the area that needs to be updated.
Take a look at this post[^] for more details on how to orchestrate the interaction between the document and its views.
Also, instead of this:
char * lpszText = new char[32];
sprintf (lpszText, "Files: %u", files->GetCount());
int nTextHeight = dc.DrawText(lpszText, [...] );
delete[] lpszText;
I suggest this:
CString sText;
sText.Format("Files: %u", files->GetCount());
int nTextHeight = dc.DrawText(sText, [...] );
It's cleaner, you don't need to worry about how much space to allocate, and you don't risk forgetting to free it.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I think I was doing the second way but I must have changed to C-Style strings for some reason, I don't know. I'm using CString's practically everywhere else. I'll take some time and read that link, thanks a lot.
edit: I just invalidated the view when the data is changed and it worked like a charm, many thanks. Practically that entire post was very informative, good call.
|
|
|
|
|
I would like to get handles to all icons in the system tray but have not been able to do this or find an answer in the MSDN.
Is it possible to get handles to all icons in the system tray and be able to remove them or modify them using the handle ?
Thankyou.
|
|
|
|
|
G Cross wrote:
I would like to get handles to all icons in the system tray but have not been able to do this or find an answer in the MSDN.
Here is answer to your query :-
http://www.codeproject.com/tools/ShellTrayInfo.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I've seen some articles with codes that has something to do with "Unicode".
How can I see the immediate effect of a program that's not "Unicode" compatible? because I'm still using char instead of TCHAR and i'm not using _T either but I haven't felt the effect of it yet.
|
|
|
|
|
Hi guys,
What database access technologies do you use for your applications at work? OCBC? DAO? ADO?
I am using VC6 to program my personal projects. At work, I am forced to use an inhouse database class, reason being it can be used in MFC and ATL projects. And also at work, we usually save data into our file format. So I have not really use any database technology.
I would like to use ADO for my personal projects. But it is very hard to find indepth information on how to use ADO in VC.
So what do you usually use?
Thank you in advance.
|
|
|
|