|
Hello
I'm thinking of using a Excel cheet to present som statistics in my appliation. Is the best way to use a html view for this or ???
Another question that really is not a c++ issue but perhaps some clever person has the awnser.
Can I retrive information from a Cell and use this in a query towards my db if yes. What is the best approach in this matter.
Regards
Henrik
|
|
|
|
|
I have a program which is using Winsock and I would like to put the local IP Address on the title bar of the dialog. Unfortunately all I get for an IP address is 0 and in dotted quad 0.0.0.0
here is some of my code:
<br />
Sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);<br />
...<br />
<br />
sa.sin_family = AF_INET;<br />
sa.sin_addr.S_un.S_addr = INADDR_ANY;<br />
sa.sin_port = htons(2000);<br />
<br />
iError = bind(Sock, (LPSOCKADDR) &sa, sizeof(struct sockaddr));<br />
<br />
SetWindowText(hDlg, inet_ntoa(sa.sin_addr));<br />
I noticed in MSDN that by using getsockname that the IP address might not be available always especially if I/O has not occured. But I thought that when I bind the socket that the sockaddr_in structure gets filled in and that one of the variables should contain the address which it is connected with. What am I missing here?
|
|
|
|
|
Warren Young provides a sample[^] as part of his excellent Winsock Programmer's FAQ.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have to develop an application in which hardcopies via keystroke are disabled. The keystrokes I know are: ALT+Print, CTRL+Print, SHIFT+Print and Print alone. How can I disable these keys in VC++ ?
Thanks ...
Olaf Rodewald
|
|
|
|
|
I'd recommend using a hook. Install it by use of SetWindowHookEx of type WH_KEYBOARD and react on your requested keys inside the provided hook function.
|
|
|
|
|
Do you have a reference for SetWindowHookEx or better an example ? Thanks, Olaf Rodewald
|
|
|
|
|
In case you need a system wide hook, you need to implement the hook function inside a DLL. The function could look sth. like this:
__declspec(dllexport) LRESULT CALLBACK HookFunction(<br />
int code,<br />
WPARAM wParam,<br />
LPARAM lParam)<br />
{<br />
char szVCode[50];<br />
<br />
sprintf(szVCode, "Virtual Key code: %lx", wParam);<br />
MessageBox(NULL, szVCode,"Key stroke", MB_OK);<br />
}
Installing it in your application is done by calling SetWindowsHookEx:
hHookDll = LoadLibrary("hook");<br />
hHookProc = (HOOKPROC) GetProcAddress(hHookDll, "HookFunction");<br />
<br />
hSystemHook = SetWindowsHookEx(WH_KEYBOARD,hHookProc,hHookDll,0);
Finally, don't forget to unload DLL and unset the hook:
UnhookWindowsHookEx(hSystemHook);<br />
FreeLibrary(hHookDll);
If you need some more detailed information, have a look at MSDN - there's lots of stuff about that topic.
|
|
|
|
|
you have to put your system wide keyboard hook in a .dll
http://www.codeguru.com/system/KBHook.html
that has a good example of a system wide keyboard hook , and an application example that uses the dll.
i was able to build my own keyboard hook after going thru that , and ive used it w/ no major problems. note there is a bug in the code there. u need to get rid of hook = NULL; line from dllmain;
hope this helps
todo....
:: insert inpirational text here ::
|
|
|
|
|
I'll try it ... Thank you ... Olaf
|
|
|
|
|
Hello,
I have a problem: I have two separate applications:
1) an ATL explorer shell extension
2) a MFC application which should display the files
Because of project reasons the files have to be different, the
explorer shell extension must be a DLL and the display application
must be a MFC project as EXE.
How can I pass the selected files from the DLL to the EXE?
I first thought of GlobalAlloc but MSDN says that this function
is only provided for 16-bit support.
What would you suggest? Is there a way to share an array? It is a bit difficult to implement an IPC system in this case...
Thanks
-Dominik
|
|
|
|
|
I'd say GlobalAlloc is just fine. IMHO the docs are a little misleading with respect to the applicability of this function (the proposed alternative, HeapAlloc and company, doesn't add much to this for your particular needs).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi, everyone!
Where is the the precompiler directive __PTHREADS__ defined?
Defined in compiler? What is the meaning and function of
the precompiler directive __PTHREADS__?
Thanks in advance,
George
|
|
|
|
|
pthreads is a unix threading library, and I can only imagine the application you are trying to compile makes use of the Win32 version of this. __PTHREADS__ will be found wherever the pthread include files are, thats about all that can be said.
|
|
|
|
|
Thanks!
I have another, does Windows use pthreads library?
If I am using Windows version of the project, can
I passby the codes has something to do with pthreads?
Cheers,
Geroge
|
|
|
|
|
Nitpicking: Pthreads is a POSIX standard (IEEE POSIX 1003.1c-1995, also known as the ISO/IEC 9945-1:1996) not a "unix" one.
"You can stand all night at a redlight anywhere in town, hailing Marys left and right but none of them slow down. I've seen the best of men go past. I don't wanna be the last..."
|
|
|
|
|
Yep, there is a version of the UNIX pthreads available for Win32 at http://sources.redhat.com/pthreads-win32/ You should be able to compile and run just about any application that uses pthreads, although if it uses other unix system calls you might run into problems.
|
|
|
|
|
|
|
Hi friends,
Are there any POP3 supporting MFC classes ?? I want to get copy of mail when the mail lands at the Server. Please suggests any links if available.
Thanks
Satya
|
|
|
|
|
there are many..search in www.codeproject.com/internet you will find many..
cheers
Himanshu
|
|
|
|
|
I try to write double values to a file. The problem is that all values have different precisions.
Example:
double d = 1.234
CString.Format("%.5f", d) causes the output to be 1.23400.
I only want to print 1.234
How can I determine the precision of a given double value?
|
|
|
|
|
What about CString.Format("%ls",d); ?
~RaGE();
|
|
|
|
|
Thanks, Rage, but that doen't work. The Prefic "l" before the type specifier has no effect on the precision. I suppose you meant "%ld" !?
Heiko
|
|
|
|
|
Sorry, i mistake myself with ascanf specifiers. Right code is
str.Format("%g",d); . This gives out 1.234 for double d=1.2340000 or d=1.234 .
~RaGE();
|
|
|
|
|
I've a problem with Property Pages within a Property Sheet.
The Font Property is set to a 10 point Font in the Resource Editor, but the Property Pages still appear in a 8 Point(I think this is default) Font.
Changing the font via SetFond function of the PropertySheet or PropertyPages doesn't change anything.
GetTabControl()->SetFont(&App.m_CLabelBoldFont) only changes the Font of the Labels in the Tab Control.
Does anybody know a solution?
I already thought of looping throug the Elements of the Property Page in the OnInitDialog function, but I don't know how. Even such a solution would be helpful to me. Thanks.
|
|
|
|