|
I would suggest studying the file format. It's available at www.wotsit.org.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
bitpusher wrote:
how to get MP3 information as is built into XP (e.g., encoding rate, etc.)?
See this[^] article.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Good time of day!
Please, help me to solve my little problem
I created split window with two views.
<br />
<br />
BOOL CMainFrame::CreateSplitters(int nRows, int nCols, int m_actRow, int m_actCol, CCreateContext* pContext)<br />
{<br />
m_bInitSplitter = FALSE;<br />
my_RightView = RUNTIME_CLASS( CRightHTMLView );<br />
my_LeftView = RUNTIME_CLASS( CMyTree );<br />
CRect cr; <br />
GetClientRect( &cr);<br />
<br />
<br />
.. <br />
if ( !m_wndSplitter.CreateView( 0, 0, my_LeftView, CSize(width/5, cr.Height()), pContext ) || !m_wndSplitter.CreateView( m_actRow, m_actCol, my_RightView, CSize(4*width/5, cr.Height(), pContext ))<br />
{<br />
...<br />
} <br />
...<br />
}<br />
<br />
But I need two create split window dynamically, 'cos later I'll need to destroy it and create another two views (but with gorizontal locating)
Please, help me.
|
|
|
|
|
Why not try splitting the OR into two statements? You may be assuming a boolean short-circuit that isn't occurring. So it's calling CreateView twice, not once.
Bob Ciora
|
|
|
|
|
I need to develop a messaging system for my dialog based appication and wanted some pointers on the approach to take. My need is as follows.
1) The main application would be the central control hub of all messages.
2) Plugins would subscribe to messages that they would like to recieve
a) keyboard presses
b) volume up
c) next ( next song event for media player )
d) etc.
3) The subscriber could possibly send a response to the recieved message.
4) Everything would be done as a result to a recieved message.
5) The subscriber should not have to scan for messages just get them and either process it
or ignore it.
Hope that make sense.
|
|
|
|
|
What about the Observer pattern ?
I don't know if it can be adapted to be used with plugin.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I am not familiar with the observer pattern. Do you know any of code examples or links
Thanks
|
|
|
|
|
Well I researched the Observer Pattern and that is pretty much how I talk to my plugins.
To me it is just more or less interfaces COM style.
What I am more interested in is the actual message passing itself.
The message could be any of the following:
1) Play was pressed. (STATE)
2) Send me the play list (List of strings)
3) etc.
Thanks
|
|
|
|
|
I am at an intermediate level in Win32 programming and am looking to master the Win32 API. Do you recommend Petzold's book Programming Windows, or the Newcomer book Win32 Programming?
Thank you for your help.
Andy Moore
|
|
|
|
|
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
|
|
|
|