|
Member 10866427 wrote: My groupbox is not working That is hardly a technical description of a problem. If you want help with somerthing then you need to provide proper details.
|
|
|
|
|
Hi,
MFC/Win32 is nothing like VB... you cannot just drop a scrollbar on a dialog/control/window and expect it to scroll the window for you. You need to do all of this yourself. You will need to have the parent window that owns the scrollbar handle the WM_VSCROLL message. You will then need to scroll the window yourself.
WM_VSCROLL message[^]
CWnd::OnVScroll[^]
ScrollWindow function[^]
Using Scroll Bars[^]
Best Wishes,
-David Delaune
|
|
|
|
|
External program used excel, if you click on the click of a button to send a message through the simulation, excel this call can not be started.
If my program is A.exe I need to simulate an external program control after clicking B.exe this B.exe a button click can not call excel
Case 1: B.exe manually click a button in excel can be a normal call! --OK!
Case 2: using the SendMessage function to send a message with A.exe analog control click on the button in excel B.exe call fails, and pop-up "can not start Excel server!"! --NG!
Messages sent using SendMessage is successfully sent, message "Unable to start Excel server!"! Also shows that the message was sent successfully, but it is not up calls excel!
Question: permissions problem? Or anything else that needs to feed?
|
|
|
|
|
|
Member 11283272 wrote: why? Why what? And probably because no one can understand your question.
|
|
|
|
|
sorry,my english is not good enough.
|
|
|
|
|
Do you have a colleague who could translate for you?
|
|
|
|
|
Sorry, I am the only one,incidentally, I'm Chinese.English is not our official language,I tried again to translate。
|
|
|
|
|
|
A.exe is my own program,B.exe is not my own program.
B.exe has a button, click it, and will call to EXCEL!
Now, my question is: if click this button to manually, EXCEL will be normal calls.---(OK)
But if use my program(A.exe),the Sendmessage function sends a keystroke messages (WM_KEYDOWN WM_SYSKEYDOWN) on the button, EXCEL will call fails.---(NG)
I'm sure it: Sendmessage function keystroke messages is sent successfully!
|
|
|
|
|
You need to be sure that the messages are exactly what the program uses to cause the button press.
|
|
|
|
|
|
Well it does not appear to be working, so there must be something still wrong.
|
|
|
|
|
Thank you, I have solved this problem.
|
|
|
|
|
Hello, can you understand what I said now ??
|
|
|
|
|
how to program that uses 4 threads to compute the sum of an array of 1000 integers.
modified 3-Dec-14 6:48am.
|
|
|
|
|
Well thanks but I've already did my homeworks, you could do it as well.
From http://www.codeproject.com/Messages/2922875/HOW-TO-ASK-A-QUESTION.aspx[^]:
2. Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
...
11. If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
|
|
|
|
|
|
#include
<stdio.h>
#include
<stdlib.h>
int array[1000]
;
void testSum()
{
int sum=0;
int j;
for(j=0
; j< 1000 ; j++)
{
sum+=array[j];
}
printf("Testing without threads, Sum is : %d \n",sum);
}
an integer is stored in
void readfile(char* file_name)
{
char ch;
FILE *fp;
fp = fopen(file_name,"r");
if( fp == NULL )
{
perror("Error while opening the file.\n");
exit(EXIT_FAILURE);
}
char line [5];
int i=0;
printf("Reading file: ");
fputs(file_name,stdout);
printf("\n");
while ( fgets ( line, sizeof line, fp) != NULL )
{
if (i < 1000)
{
array[i]=atoi(line);
}
i++;
}
fclose(fp);
printf("Reading file Complete, integers stored in array.\n\n");
}
int main(int argc, char* argv[])
{
if (argc != 2) {
fprintf(stderr,"usage: a.out <file name>\n");
return -1;
}
readfile(argv[1]);
testSum();
return 0;
}
|
|
|
|
|
i don't want to bother you ! ,
|
|
|
|
|
0. Split your array into four parts (use the pointer to determine where you're doing the split, don't make another copy of the data)
1. Create worker threads to sum each with their portion (pointer to the beginning and size).
2. Wait for all threads to finish, sum their results.
If this was a program that needed to do this over and over again, I'd also create a "thread pool" that is precreated. Creating threads on the fly is actually a pretty slow process, you want to do it sparingly.
|
|
|
|
|
Circular buffer in embedded c
|
|
|
|
|
|
A 'string' in c is nothing more than a sequential sequence of bytes terminated with a null.
But a circular buffer is not guaranteed to be sequential. So without at least some further restrictions it cannot be done.
|
|
|
|
|
You may either want to use the circular buffer for holding the pointers of the actual strings or, more likely, for holding the strings themselves.
In the first case coding is pretty straightforward (you may use Wikipedia's circular buffe[^]r page for inception).
On the other hand, the second case is bit more complex, since you have to explicitely manage blocks of bytes (the strings) in the circular buffer.
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|