|
can you please tell me how it's called and how I can apply it to a dialog box??,
I'm unable to find it into Visual Studio's Toolbox
Thanks
Paolo
|
|
|
|
|
|
Hi,
I am trying to get the IPv6 address. I am using following code.
IP_ADAPTER_ADDRESSES ipadd;
ULONG buflen;
DWORD err;
memset(&ipadd, 0, sizeof(ipadd));
err=GetAdaptersAddresses(AF_INET6,GAA_FLAG_SKIP_DNS_SERVER,NULL,&ipadd,&buflen);
but whenever the code is executed the application close down without any error.
I am compiling this by using WinXP SP2 SDK and using VS 6.0
Please Reply
Regards
Alpha
|
|
|
|
|
How about:
IP_ADAPTER_ADDRESSES *ipadd;
ULONG buflen;
GetAdaptersAddresses(AF_INET6,GAA_FLAG_SKIP_DNS_SERVER,NULL,NULL,&buflen);
ipadd = new IP_ADAPTER_ADDRESSES[buflen];
GetAdaptersAddresses(AF_INET6,GAA_FLAG_SKIP_DNS_SERVER,NULL,ipadd,&buflen);
...
delete [] ipadd;
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
Thanx for reply It's working now. But I don't really know I am not getting the desired output. It shows all return values in box junk characters.
for example the code
CString strFinal;
IP_ADAPTER_ADDRESSES *ipadd;
ULONG buflen;
GetAdaptersAddresses(AF_INET6,GAA_FLAG_SKIP_DNS_SERVER,NULL,NULL,&buflen);
ipadd = new IP_ADAPTER_ADDRESSES[buflen];
GetAdaptersAddresses(AF_INET6,GAA_FLAG_SKIP_DNS_SERVER,NULL,ipadd,&buflen);
strFinal.Format(L"Name of Adapter %s",ipadd->AdapterName);
delete [] ipadd;
The ipadd->AdapterName returns value in junk character.
Thanks for reply
Regards
Alpha
|
|
|
|
|
Alpha Siera wrote:
strFinal.Format(L"Name of Adapter %s",ipadd->AdapterName);
Just curious, but since you are using Unicode, shouldn't that %s be a %S instead?
I don't have Windows XP Pro or Windows .NET Server so I cannot test your code snippet.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Was a linkedlist.obj file produced?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
below is the output & there object files for all source files.
Compiling...
linkedlist.cpp
-+- COMPILING i:\program\user\richard millen\source\_dev\list_test\list_test\linkedlist.cpp
-+- COMPILING i:\program\user\richard millen\source\_dev\list_test\list_test\linkedlist.h
-+- COMPILING i:\program\user\richard millen\source\_dev\list_test\list_test\linkedlist.h
main.cpp
-+- COMPILING i:\program\user\richard millen\source\_dev\list_test\list_test\main.cpp
-+- COMPILING i:\program\user\richard millen\source\_dev\list_test\list_test\linkedlist.h
-+- COMPILING i:\program\user\richard millen\source\_dev\list_test\list_test\linkedlist.h
i take it linkedlist.h is being run through the compiler twice because there are 2 classes in there (linkedlist & listelement)!?
|
|
|
|
|
Is there a way in a CFormView-based class to get a control by it's id like GetDlgItem() that returns a (CWnd*)
[insert witty comment here]
bdiamond
|
|
|
|
|
bdiamond wrote:
Is there a way in a CFormView-based class to get a control by it's id like GetDlgItem() that returns a (CWnd*)
You may need to rephrase this question , but you have just answered your own question. GetDlgItem() should work as described in any CFormView class.
I Dream of Absolute Zero
|
|
|
|
|
Can someone point me in the right direction for creating a download progress dialog while an activeX control is installing. I presume it's some kind of callback but would appreciate some help. (examples)
thanks in advance
Carl
|
|
|
|
|
Hi, I've got a need to include an .exe inside a dll. Basically the dll is downloaded from a web site and needs to copy (unpack) the .exe to a destination directory. My first thought is to include it as a custom resource. Before going down that road i would like to know if anyone can offer a better solution?
thanks - Carl
|
|
|
|
|
There's nothing wrong with your approach. See here for an example.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks David! - just what i was looking for
One question...
Do you know if this could be done with an activeX control? (MFC based)
I'm going to try it but wondered if you might know.
Carl
|
|
|
|
|
crandall wrote:
Do you know if this could be done with an activeX control?
It'll work for any file. Bytes in a file don't mean anything until the application that understands them gets involved. All you are doing is taking a bunch of bytes and adding them as a resource to some other file. Whether you added winword.exe or mypict.jpg to your .exe file, bytes are bytes.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I think you may have misundertood me a little. i meant adding an application (bytes) to the activeX control. I guess it's the same but i just wondered as a certain structure is assumed to qualify to be a COM object etc.
Thanks
Carl
|
|
|
|
|
crandall wrote:
I think you may have misundertood me a little.
Apparently I misunderstood you a bunch. I do not know how to add to an ActiveX at runtime.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Do you fancy having a look at the above Message of mine on the download Progress for an activeX control.
Thanks in advance!
Carl
|
|
|
|
|
I don't quite understand your request. I don't see mention of any progress control in any of your posts in this thread. Did I miss it?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Dear friends,
I got an edit box, the user enters the string in the edit box that my application collects in the associated CString variable m_edit_customerAddress .
But the problem is that users are entering characters like "space bars", "tabs" "new line" , in the beginning of the string and at the end of the string. What i want to remove thiese characters from m_edit_customerAddress . How can i do so ?
Imtiaz
|
|
|
|
|
Imtiaz Murtaza wrote:
...users are entering characters like "space bars", "tabs" "new line" , in the beginning of the string and at the end of the string.
Is this a multi-line edit control? In any case, after the variable is populated with the control's contents, simply call iswhite() for each character.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
You can use the CString member function ::TrimLeft() and ::TrimRight() to remove any unwanted characters at either end of your string.
If your string has a mixture of these characters, then its a bit more difficult to infer where your 'valid' input string starts and ends.
I Dream of Absolute Zero
|
|
|
|
|
Ok..So I'm making a program for the "Connect Four" game. You know the one that you try to get 4 colors in a row by dropping a chip in between 2 players.
Well My problem is my function called displayBoard this method places 2 different kinds of markers on the board (one for each player) and displays some kind of marker for empty slots. Be sure your choices are easy to see.(i.e. X's for player 1, O's for players 2)
Well having the data members being...
//data members
int board[12][13];
int numChips[7];
how would I write the function...displayBoard?
All I have so far is this in my .cpp file
void ConnectFour::displayBoard()
{
for(int i=0; i < 12; i++)
{
for(int j=0; j<13; j++)
{
cout << board[i][j] <<" ";
}
cout << endl;
}
}
|
|
|
|
|
The displayBoard() method is fine. What you need to do is populate the board variable with Xs and Os.
You need a method that asks the user which of the seven slots they want to insert a piece into. If that slot is not full, add a piece to it (this is the real meat of your program). Otherwise, tell them the slot is full and ask again.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
ok...but all i have is
cout << "What column do you want to drop a chip in?;
cin >> //do i use an arrary for cin?
for(int j=0; j<13; j++)
{
cout << board[j] << "X";
}
~jason
|
|
|
|