|
Never heard of the new one, but Petzold's "Programming Windows" is a must have.
-- Rocky Dean Pulley
|
|
|
|
|
The Newcomer book is a lot of MFC/C++, Petzold deals more directly with the C api's.
|
|
|
|
|
Thanks everyone for your input.
Andrew Moore
|
|
|
|
|
Greetings!
I am trying to implement the Active Accessibility capabbilities to my ATL ActiveX control.I have added
#include <initguid.h>
#include <oleacc.h>
#include <winable.h>
and the paths to where oleacc.lib AND oleacc.dll are present in the settings of VS 2003. However I am getting the following errors when I try to compile.
Knob.obj : error LNK2001: unresolved external symbol _PROPID_ACC_ROLE
Knob.obj : error LNK2001: unresolved external symbol _PROPID_ACC_VALUE
Knob.obj : error LNK2001: unresolved external symbol _CLSID_AccPropServices
Debug/Controls.dll : fatal error LNK1120: 3 unresolved externals
Any ideas as to what is going wrong?
Thanks in advance,
Aristotel
|
|
|
|
|
Anyone?
|
|
|
|
|
Need a bit of help please
I'm coding a tool that creates iso files from cd/dvd disks, all was going well until I tested on a dvd disk (cd disks work fine) but for some reason the program cannot read direct from the dvd.... I know the code works as it reads direct from the cd in the same dvd drive as I tested the dvd disk in. I also made sure windows was able to read the dvd correctly to rule out a damaged disk.
What I need to know is, is there some kind of extra 'unlocking' routine or something that needs to be performed before I have access to the dvd
I should also mention the dvd in question is not a dvd movie disk, but a dvd data disk created originally with nero.
Any help on this will be appriciated.
|
|
|
|
|
I want to show dialog window (with image) for 3 seconds befor my project will start.
I use Timer with aim to destroy dialog window in 3 seconds
<br />
<br />
BOOL CRightHTMLView::PreCreateWindow(CREATESTRUCT& cs)<br />
{<br />
<br />
dlg = new CDialog(IDD_ABOUTBOX, this);
<br />
MSG message;<br />
int i=0;<br />
m_nTimer = SetTimer(1, 100, NULL);
ASSERT(m_nTimer!=0);<br />
if(i==0)<br />
{<br />
dlg->DoModal();<br />
if(::PeekMessage(&message, NULL, 0, 0, PM_REMOVE)) {<br />
::TranslateMessage(&message);<br />
::DispatchMessage(&message);<br />
}<br />
i = 1;<br />
}<br />
return CHtmlView::PreCreateWindow(cs);<br />
}<br />
<br />
void CRightHTMLView::OnTimer(UINT nIDEvent)<br />
{<br />
Sleep(3000);<br />
dlg->DestroyWindow();<br />
KillTimer(1);<br />
<br />
CHtmlView::OnTimer(nIDEvent);<br />
}<br />
<br />
What is wrong in my function(s)? If anybody knows how to display image in other way (not in dialog window), please
share here with your ideas. I would appreciate your co-operation.
Aleksey.
|
|
|
|
|
In PreCreateWindow() your window hasn't been created yet (thus the "pre" in the name) so you can't do things like set timers or pump other messages that rely on window handles.
--Mike--
LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
Is it possible to show an asscess database report in an MFC app. Or run an access database app / form in a MFC application?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
|
//This program read file *.txt, than 100 float numbers(or int numbers, if they are present)
//write in a float array.Next, finds MIN and MAX element in float array with using pointers,
//write results on the screan and if there is no more numbers, go to end, else repet all again.
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#define MAXELEMENTS 100 // MAX numbers of elements
//funkcion for max element in float array
float *biggest(float table[],int number)
{
int counter, counter_max;
float aretheysame=0;
for(counter=0; counter < number; counter++)
{
if (*(table+counter) > aretheysame)
{
aretheysame = *(table+counter);
counter_max = counter;
}
}
return(&*(table+counter_max));
}
//finkcion for min element in float array
float *smallest(float table[],int number)
{
int counter, counter_max=0;
float aretheysame=table[0];
for(counter=0; counter < number; counter++)
{
if (*(table+counter) < aretheysame)
{
aretheysame = *(table+counter);
counter_max = counter;
}
}
return(&*(table+counter_max));
}
main(void)
{
FILE *in;
char inter[255];
int num_elements=0;
float element;
static float table[MAXELEMENTS];
float *small,*big;
printf("Adress and value of max and min element in array\n");
printf("Enter file name : ");
gets(inter);
in= fopen(inter,"r");
if(in == NULL)
{
printf("Error. No file with this name\n");
exit(1);
}
while (fscanf(in,"%f",&element) != EOF)
{
table[num_elements] = element;
num_elements++;
}
if (num_elements > 1)
{
big=biggest(table,num_elements);
printf("\nThe adress of max element is %d",&*big);
printf(", with value %f",*big);
small=smallest(table,num_elements);
printf("\nThe adress of min element is %d",&*small);
printf(", with value %f",*small);
}
else
{
;
}
fclose (in);
getchar();
}
And *.txt file:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2000 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
15 14 13 22 55 2 5
The program find min and max from all numbers in file, but not only from 100.
It must be able to do that with long txt files too, and each 100 numbers is work with number (1. work(for first 100 num), 2. work(for secund 100 num),...)
Where I am doing wrong ? Please, help me !
|
|
|
|
|
If there are more than 100 numbers in the file, you'll need to change the value of MAXELEMENTS . A better solution would be to use a dynamic array. That way you do not have to keep changing and compiling code when the size of the input file changes.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
I'm having trouble trying to understand what your problem is. You want to read all numbers and get the largest and smallest? I'm not understanding what you say is going wrong. I would try something like this:
#include <set>
#include <iostream>
using namespace std;
set<int> nums;
ifstream in(filename);
while(in)
{
int n;
in >> n;
nums.insert(n);
}
set<int>::iterator it = nums.begin();
cout << "first = " << (*it) << endl;
int last;
while(it != nums.end())
{
last = (*it);
it++;
}
cout << "last = " << last << endl;
-- Rocky Dean Pulley
|
|
|
|
|
I want to read all numbers and get the largest and smallest, but only from first 100 numbers in array[100], after that the same with another 100 numbers and so on.
|
|
|
|
|
As you are reading in the numbers, if num_elements is a multiple of 100, then call biggest() and smallest() .
Another way would be to read all of the numbers in the file, and call the biggest() and smallest() functions once for each group of 100 numbers, like:
big1 = biggest(table, 100);
big2 = biggest(&table[100], 100);
big3 = biggest(&table[200], 100); Make sense?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Yes, but how can i write big10489=biggest(&table[1048800], 100); ?
This will take a lot of my time. And i don?t now, if file is so long?
|
|
|
|
|
dr.eu wrote:
Yes, but how can i write big10489=biggest(&table[1048800], 100); ?
Exactly like that. This assumes that you have read at least 1,048,900 numbers from the file.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
In that case, i have to import another counter j:
int j;
bigj=biggest(&table[j], 100);
Is right so?
|
|
|
|
|
If not using STL at all is an option, you might ask yourself why you store the numbers in an array in the first place. Just keep track of the smallest and largest numbers you fscanf'ed so far.
|
|
|
|
|
it sounds like he has to for a homework assignment. It sounds like a pretty lame homework assignment, must have been a math teacher turned programming teacher.
-- Rocky Dean Pulley
|
|
|
|
|
About homework you have right ! About teacher ... Who nows ?
Any way could you help ?
|
|
|
|
|
I can't really do your homework for you, you won't learn anything that way. Besides, you are 90% there, just take the time and figure it out, you're almost done.
-- Rocky Dean Pulley
|
|
|
|
|
Yes, from that almost i am gona crazy. The result is O.K. (for all numbers in file). Help me please with 100, 200, ... elements in array !!!
|
|
|
|
|
just use the same array, once you hit a number where (current_number % 100 == 0) then do your biggest/smallest check and reset current_number to 0, keep going on after that and it will just reuse your 100 item array.
-- Rocky Dean Pulley
|
|
|
|