|
Hi
How can check if a CWnd object atteched to a valid handle?
I've tried this:
bool isValid = pWnd->GetSafeHwnd() == NULL;
but sometime GetSafeHwnd() returns me 0xfeeefeee
thanks.
|
|
|
|
|
try
isValid = IsWindow(m_hWnd);
Hope it Helps
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
thanks
|
|
|
|
|
Hi all,
I choose grey property for File menu item.
how can i un-grey it at run-time
Thanks all,
best regards,
|
|
|
|
|
I knw how to make a Win32 Dll and implicit link it with the Win32 client in Same directory. What are the steps involved in exporting a function to a VB client.And can VB client use it as simle C function
Rum + Whisky is very Risky
Cheers!!!!
Siddharth
|
|
|
|
|
Hi all,
i need to store the elements in the integer array from two different files in a buffer. Then i need to compare the elements in the arrays. How do i store the array into buffer.Thank you for all your help.
Ivory
|
|
|
|
|
i want to count no of controls added in my dialog window in VC++
|
|
|
|
|
EnumChildWindows should do the trick.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I am trying to write a Visual C++ program that takes Questions and Answers as input (Combo Box) and provides persistent storage in a file on a CD that contains the program. I want to call this program Notebook, because it is the form I like to take notes in - Questions - the Answers to which demonstrate knowledge of the subject matter. This program will be used for various study purposes. I eventually want to evolve the program into one that uses jpeg file pictures of plants with their names in the place of Questions and information being tested about them in the place of Answers. That one will be used by my wildlife biologist friend. Has anyone seen a good "go-by" for such a program?
The closest thing I have seen was in MFC/C++>>Combo and List Boxes>>Beginners by Wolfram Steinke as his CComboBox control demo.
|
|
|
|
|
1.I have a question: when i use UDP/IP protocol, sometimes I can receive the data,others are not,if I debug the program, I can receive the data without delaying,I dont know why it happend ,and I have no way to execute it;
2.The completionPort model adapats the UDP/IP protocol,or not?
|
|
|
|
|
are u using multicast udp?
if so remember a lot of routers block udp multicast packets
"there is no spoon" biz stuff about me
|
|
|
|
|
NO,I don't use the Multicast, I use the UDP/IP in the common C/S model, I want to recevie the data use the completionport,
for the chat,....
if you talk about the completionport ,pelease email me , I will send the code to you,
|
|
|
|
|
Hey all.
Just wondering, what would be the best way to find out what the user's windows directory is? (e.g, sometimes its c:\winnt, other times c:\windows, or whatever other ideas the user decides to come up with).
I want to be able to call (HH.EXE) which resides in the users system directory to launch my HtmlHelp files. I realize that I can simply call the .CHM file with shellexecute and that will launch it as long as the file type has been defined. But I want to be on the safe side in case that file type is not defined.
I preferably do not want to have to get the windows directory by accessing the environment variable "windir", but if that is the best way about it, I guess it'll suffice! If so, can someone tell me how to go about accessing this environment variable ... or if there is a better way, enlighten me?
Thanks
Shultas
|
|
|
|
|
I think that unfortunately this is one area you have to read the environment - you didnt say what O/S here, I'm assuming NT.. try this :-
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
char * sysdir = getenv("SystemRoot");
if (sysdir)
cout<<"value of SystemRoot is: "<< sysdir<
|
|
|
|
|
I dont know how accurate this info is, but I'm going to contradict myself and offer this link I found after a quick look see a-la-google (and I just learnt something for today, that there does appear to be some API's for it other than looking in the environment) ..
http://www.qinysoft.com/articles/vcdirectory.htm[^]
hth, 'G'
|
|
|
|
|
TCHAR szBuffer[MAX_PATH];
GetWindowsDirectory(szBuffer, MAX_PATH);
|
|
|
|
|
This is something I haven't mastered for some reason.
I am trying to count the number of elements in a one-dimensional array to loop through it so I figured it would be something like sizeof(array) / sizeof(array[0])
Unfortunately this always returns 1. The array consists of 12 longs (but it is empty to begin with and during the calculation. Do different rules apply to empty arrays, and what is the workaround)
Thanks.
|
|
|
|
|
The sizeof trick only works for staticly allocated arrays. It sounds like you're doing something like:
long* ptr = new long[12]; Since the type of ptr is long* , sizeof(ptr) is 4. ptr[0] is a long , and sizeof(long) is also 4. To do what you want, you would have to write:
long arr[12]; Now sizeof(arr) == 12*sizeof(long) == 48.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt
"Linux is good. It can do no wrong. It is open source so must be right. It has penguins. I want to eat your brain."
-- Paul Watson, Linux Zombie
|
|
|
|
|
I have declared the array staticaly in one function and then passed this empty array in another function (to fill it up) and it is in the second function that sizeof(arr) == 1...I don't understand it!
The function parameter list (2nd one goes something like this)
void(..., ..., long arr[])
{
...
}
|
|
|
|
|
That's because when you pass an array as function parameter, the function always receives a pointer just as if it were declared long* arr . You can't pass an entire array in C.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
Right!!!! I forgot about the "call by" rules!!! Thanks.
|
|
|
|
|
Alternatively you could use the Standard Template Library Vector. Which means you don't have to worry about memory allocations or keeping track of sizes of arrays.
// Declare a vector
std::vector<long> data(12);
// Access Elements
data[0] = ...
data.at(0) = ...
// Add element
data.push_back(...);
// Retrieve size of vector
data.size()
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Hi,
when i m trying to transfer the encoded packet after escape encoding it from client to server using foloowing code snippet.......
AES_EncodeForService(data,key,&res,&len);
// disard <aes_encode> &
strcpy(tempstr,"");
j=0;
for (i=12;i<strlen(res)-13;i++)
{
="" tempstr[j]="res[i];
" j="j+1;
" }
="" ;
="" escape="" encoding...........
="" strcpy(res,"");
="" strcpy(res,tempstr);
="" strcpy(tempstr,"");
="" for="" (i="0;i<strlen(res);i++)
" if="" (="" !(isalnum(res[i])))
="" sprintf(tempchar,"%s%x","%",__toascii(res[i]));
="" else
="" sprintf(tempchar,"%c",res[i]);
="" strcat(tempstr,tempchar);=""
="" combine="" encoded="" with="" tags.....
="" sprintf(withcode,"<aes_encode="">%s",tempstr);
// construct a packet with header followed by footer........
strcpy(packet,header);
strcat(packet,withCode);
// set buffer
len=strlen(packet);
sprintf(sendbuf,"POST /services/ws.asp HTTP/1.0\r\nContent-type: application/x-www-form-urlencoded\r\nContent-length: %d\r\n%s\r\n\r\n",len,packet);
// length of buffer
len=strlen(sendbuf);
// send packet..............
bytesSent = send(ConnectSocket,sendbuf,len,0);
printf("\nBytes Sent: %ld\n\n", bytesSent );
/// receive packet..........
bytesRecv = recv(ConnectSocket,recvbuf,10000,0);
// if doesn't receive the bytes.....
if (bytesRecv <= 0)
printf("\n Error : %d",WSAGetLastError());
// display the received content.........
else
{
printf("\n Receive buffer : %s\n\n",recvbuf);
AES_Decode(recvbuf,key,&recvData,&len);
printf("\n Decode : %s \n\n",recvData);
}
my problem is that the characters which r not aphanumeric get changed and hence does not able to decode it properly.
chirag_a_chauahn
|
|
|
|
|
So what is the problem? Is it the encryption or the data transfer?
Kuphryn
|
|
|
|
|
Okay, so I have this product that modifies a jet database, and now it doesn't work. The program who's database I was modifying switched to MSDE databases. So, I'm assuming that I must do something different programmatically. I just don't know what. Also, I can't even figure out how to create a test MSDE database. I don't even know if it's still a .mdb. Can anyone help?
halblonious
|
|
|
|