|
Hello "knoppenbonker"
First rtfm before you ask questions to this forum. For this time I spare you. Here's your code:
WSADATA wsaData;
struct sockaddr_in sock;
char hostname[128];
WSAStartup(0x0101, &wsaData);
gethostname(hostname, 128);
HOSTENT * lpHost = gethostbyname(hostname);
memcpy(&(sock.sin_addr), lpHost->h_addr_list[0], lpHost->h_length);
TRACE2 ("Host Name: %s IP address : %s",hostname, inet_ntoa(sock.sin_addr));
WSACleanup();
Considderd to be the worlds fastest knoppenbonker.
10 Months of working experience with the worlds fastest copie paster(about 2000 lines a minute).
And experience with the one and only NewEra Guru.
|
|
|
|
|
I am trying to get tooltips to work in a dialog application over a
static control.
In maindlg.h I declare:
CToolTipCtrl ctipQStatus
And in OnInitDialog:
RECT rcTest;
BOOL bTest = ::GetWindowRect(GetDlgItem(IDC_MGOOD), &rcTest);
CToolInfo ctiTest(TTF_CENTERTIP, m_hWnd, IDC_MGOOD,&rcTest, "Tooltip Test");
HWND hwTest = ctipQStatus.Create(m_hWnd);
bTest = ctipQStatus.AddTool(ctiTest);
ctipQStatus.Activate(TRUE);
Am I just completely missing how to use this?
Thanks,
sbl
|
|
|
|
|
I am using an MFC CListCtrl with multiple columns. I have two related problems:
1. I can select an item (column 0) by left or right clicking on it but subitems don't respond when clicked. I would like to pop up a floating menu on any item or subitem when right clicked.
2. There seems to be no way that I can get the control to set the subitem attribute to selected (LVIS_SELECTED) and display blue. I have looked at SetItemState (no good, can't see subitems) and SetItem (does not work, just ignores the status change).
Does anyone know how to make this SOB do as it is told and allow me to select a subitem?
Has anyone done this without MFC using only the SDK API?
|
|
|
|
|
Make this call:
yourListCtrl.SetExtendedStyle( yourListCtrl.GetExtendedStyle() | LVS_EX_FULLROWSELECT;
Then, clicking anywhere in a row will select the whole row. This requires v4.70+ of the common controls.
--Mike--
http://home.inreach.com/mdunn/
Time is an illusion; lunchtime doubly so.
|
|
|
|
|
A thousand blessings upon you! Works like a charm. (It's all there in the MSDN too. I must be getting old and blind.)
|
|
|
|
|
Does anyone know how to setup MSVC 6 to use a custom compiler? For example, I might want to use gcc or the intel compiler...
thanks
|
|
|
|
|
I tried the Intel compiler recently. They supply an addin (on the tools menu) which allows you to select the compiler to use.
I had some problems switching between the two - the tool seems to modify the DSP to change the variables that point to cl.exe and link.exe to point to their intel counterparts, and it sometimes doesn't do a very good job of cleanup when you want to revert.
The intel compiler, though, seems to honor all the VC settings flawlessly - doubt if gcc would. You might have to export the make file, change some .exe entries as above, then go from there - make files are not very portable.
You might want to check out Al Stevens work on quincy99 - http://www.midifitz.com/alstevens/quincy99/
He's been working on a new front end, and I think it works with the Mingw32 port of gcc.
|
|
|
|
|
I need to sent data from my application to MS Word and printing them there. What is the simplest way for doing this ?
|
|
|
|
|
i'm not expert for this but because of longer no-reply:
open explorer, options, file types, microsoft word document, edit, print, edit and you will see what explorer makes
all msdn examples i see are in vb what is not my domain
maybe this helps you
t!
|
|
|
|
|
Hi all,
Do you know how to use the function sndPlaySound() in MFC? I had put it in my program, but it
got an error. Is it any header file or other declaration is needed before calling this procedure?
Thx for your help!
|
|
|
|
|
sndPlaySound is obsolete, use PlaySound instead.
Header: mmsystem.h.
Library: winmm.lib.
|
|
|
|
|
But do I need to declare anything else before calling this function, or any objects should be created first?
Since I get "undeclared identifier" when calling this function.
Thx a lot!
|
|
|
|
|
Hi All,
My app uses a MS Access db that is password protected. I have a new requirement that I create a copy of the db that is not protected (I'm using DAO). Is there a way to unset the password of the copy from within VC++? I guess I can always build the copy from scratch (so the password isn't copied), but that would be a pain.
Thanks.
Paul Ebert
pebert@ix.netcom.com
|
|
|
|
|
Check out the MSDN article "TN054: Calling DAO Directly While Using MFC DAO Classes".
|
|
|
|
|
Hi all,
I want to make a 2D array of CString in MFC.
Can I know if it is possible and how to declare and make it work??
Thx for your help!
|
|
|
|
|
Don't hate me but I don't think you can do it. I gave up after trying for a week. Currently I'm using linked CStringArray objects. Not neat but works.
|
|
|
|
|
Why I need to hate you that you gave me advice? ^v^!
Anyway, can I know how to use CStringArray to construct a 2D array? Can you show me how to use and declare it?
Thx for your sincere help!
|
|
|
|
|
|
I think I misunderstood something. (Read it at 4.30am so...)
What I tried to do was a 2D CStringArray, derived from CStringArray, so that I could dynamicaly assign CString objects and have the array class allocate and clean up at run-time. I'm using "CStringArray fred[ 2 ]" at the moment. This is not neat at all as I said but works OK. I ass-u-med the original post was about this.
|
|
|
|
|
Hi
Today I bumped into this. I'm working on an MFC app. When I link MFC statically, something goes wrong when the application terminates. A box comes up with "Memory 0x0000 0000 referenced 0x0000 0000, Memory could not be read", I can abort or debug.
This only happends when linking statically to MFC. It doesn't matter which configuration I use, both debug and release behaves this way. I've tried to debug ofcourse. I can follow the execution out of WinMain, but not further.
Any ideas?
|
|
|
|
|
Hi,
I have an application that draw numerous line of text in the main window (this text is drawing from a printing class that I want to send to the display device context).
When I scroll the window, the lines of text are repeated (similar to a figure that is separated when we scroll).
I have put in OnDraw functions like SetROP2 and SetTextColor with CLR_NONE.
But I am not sur that is the good way.
Anybody has suggestions ?
Thanks
Claude
|
|
|
|
|
You mean scrolling does not work ? You need to use GetScrollPosition() to position your text based on where the scroll bars are.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
For this problem i used MFC with Visual Studio 6.
I've some question and i'm not sure if what i want is possible. Maybe you
can help me. I want to create some very simple multithreaded environment for
activex controls. I know there are the synchronization issues with
multithreading but that will be a next step. For now even the basics doesn't
seem to work with me.
I want to created a container control. In design time it acts
just like a normal activex container. You can put other activex controls on
it. The container control can be hosted by an other container such as a VB
form. In runtime it spans a CWinThread object and creates a window in that
threat. The window is a child of the VBForm and a parent of the activex
control container. Which makes the activex control and it's children running
in a new thread. This is the theory
I manage to create a window in a CWinThread object. I manage to put the
window between the form and the activex control container. When i look with
spy++, the window between the form and the container is running in a new
thread as i expected. But the control container and it's controls are still
running in the same thread of the VBForm.
I used a override of the CreateControlWindow method of COleControl to
reparent the control. Maybe this is way to simplistic. I also tried the
ReparentControlWindow override with the same effect.
Is it possible what i want ??
Is it more complicated then i at first thought ??
Are there hooks in the MFC control creation process that allow this ??
Do i've to create the controls dynamically from within the new threaded
window ??
|
|
|
|
|
How can I open a web page in the default web browser of my system?
Thanks!
Erik
|
|
|
|
|
Call ShellExecute() and pass it the URL, and use "open" as the verb.
--Mike--
http://home.inreach.com/mdunn/
Time is an illusion; lunchtime doubly so.
|
|
|
|