|
Instead of using the class X, use a pointer to the class:
Class Y<br />
{<br />
X* m_Item;<br />
}
This will solve your problem because you won't have to include the X.h header in the Y.h file (you'll have to include it in the Y.cpp file instead).
Hope this helps
|
|
|
|
|
Just remove line
#include "y.h"
from X.h file
it should work
greatest thing is to do wot others think you cant suhredayan@omniquad.com>
messenger :suhredayan@hotmail.com
|
|
|
|
|
How do i set the size of column/row of the grid?. Also, is there a way when i click on a cirtain column, the data sort itself?
|
|
|
|
|
MFGrid.ColWidth(0) = xxx;
greatest thing is to do wot others think you cant suhredayan@omniquad.com>
messenger :suhredayan@hotmail.com
|
|
|
|
|
ColWidth is not a member of msflexgrid but SetColWidth is but what the parameter to use?
|
|
|
|
|
Hi,
How does LVA_SNAPTOGRID (The Arrange function) work in a CListCtrl?
I am trying to e.g. have a grid of images displayed.
Lets say 6x5 in a CListCtrl but even when I use SetIconSpacng the vertical spacing
is not correct. The horizontal spacing is ok though.
Ideally I would like to have one list ctrl with grid lines drawn on.
Then the user can put the desired image inside the relevant portion of the grid.
At the moment there is a large space between each image on the vertical.
If I could just work out how to align 4 images in a 2x2 grid then I could probably move on from there.
Thanks,
|
|
|
|
|
Have I not explained this sufficently enough?
The basic question is that I would like to have 4 images in a list ctrl but I would like
to remove the text description for each image. I would like to arrange then with two on top and two images below.
Regards,
|
|
|
|
|
i have made an application in which multiple clients can send messages using CAsynSocket. Now i want to add a functionality that when a client tries to connect to the server then an alert is given from system try. just like on msn messenger some new body signs in then an alert message is genrated. Can some body help me about that.
|
|
|
|
|
|
I have a very complex dialog. Sometimes OnOK() doesn't work, meaning that when OnOK() is called, the dialog still there. Sometimes OnTimer() wasn't called, seems that the dialog hangs in somewhere. Any suggestion?
Thanks!
|
|
|
|
|
before exiting the OnOk method call the baseclass OnOk() like this CDialog::OnOk();
ykg888@yahoo.com wrote:
seems that the dialog hangs in somewhere. Any suggestion?
Yeah one suggestion, debug the app and find out where it is hanging.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
ykg888@yahoo.com wrote:
...when OnOK() is called, the dialog still there.
How are you verifying that OnOK() has been called?
ykg888@yahoo.com wrote:
...seems that the dialog hangs in somewhere.
At this point, is the dialog still visible?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I am Working on TAPI 2.0 and I develop a Software like Predictive Dialer IN Visual C++ 6 and
Facing Some Problems.
Problem 1: Problem is that I want to Detect Any Tone e.g(Fax Tone, Ringing Tone, Busy Tone.....)
Problem 2: My program also skip few Events (Ringning, Accepted).
I Used these Steps
Line Initialize:
----------------
lparams = new LINEINITIALIZEEXPARAMS;
lparams->dwOptions =LINEINITIALIZEEXOPTION_USEHIDDENWINDOW;
lparams->dwTotalSize = sizeof (LINEINITIALIZEEXPARAMS);
lparams->dwNeededSize = sizeof (LINEINITIALIZEEXPARAMS)*2;
lparams->Handles.hEvent = MyCallBack;
1>lineInitializeEx(&hLineApp,hcurr,MyCallBack,szAppName,&no,&ApiVersion,lparams)
.....(Few Line of Code)
2>lineOpen(hLineApp,dwDeviceID,&hLine, ApiVersion,0, (DWORD)MyCallBack,
LINECALLPRIVILEGE_MONITOR,LINEMEDIAMODE_INTERACTIVEVOICE , 0)
......(Few Line of Code)
Select Device
-------------
lineGetDevCaps(hLineApp,i,dwAPIVersion,0,lpLineDevCaps)
.....(Few Line of Code)
Dial Number
-----------
lineMakeCall(hLine,&lphCall,lpsz ,0,NULL);
On Event Line_Reply
-------------------
lineSetCallPrivilege(*lphCall,LINECALLPRIVILEGE_MONITOR);
On Event LINECALLSTATE_CONNECTED
--------------------------------
LINEMONITORTONE LineTone[10];
LineTone[0].dwAppSpecific = CallBackInst;
LineTone[0].dwDuration = 750;
LineTone[0].dwFrequency1 = 400;
......(Few Line of Code)
lineMonitorTones(lphCall,LineTone,0);
I Use MODEM
Maze InterNal 56k Fax Modem ITU-T V.92/90
|
|
|
|
|
Ahmed Jahanzeb wrote:
Problem 1: Problem is that I want to Detect Any Tone e.g(Fax Tone, Ringing Tone, Busy Tone.....)
Problem 2: My program also skip few Events (Ringning, Accepted).
I think the problem is more likely to be the modem than your code. Modems only tend to support a small-subset of the TAPI interfaces. A lot depends on the TSPI used. I've rarely seen a modem that gives anything other than a LINECALLSTATE_CONNECTED when making outgoing calls.
I'd recommend downloading some of the test apps (EnumTapi/Phone) from JulMar samples[^]
These should give you a clearer idea of what your modem supports.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
How can I send a fax programmatically?I am very interested in this subject.
|
|
|
|
|
Program Code:
#include<stdio.h>
#include<time.h>
#define N 1024
int i,j,k;
float slice[N][N];
void main()
{
time_t start,end;
float s;
start=time(NULL);
for(k=0;k<100;k++)
{
for(j=0;j<n;j++)
="" for(i="0;i<N;i++)" {=""
<code=""> slice[i][j]=(float)(slice[i][j]+0.01);
slice[j][i]=(float)(slice[j][i]+0.01);
}
printf("%d\n",k);
}
end=time(NULL);
s=difftime(end,start);
printf(" The total time is %f:",s);
}
Questions or problems(Compiled by Visual C++ 6.0):
1.If N equals 1022,1023,1025 or 1026, its run time is about 13 seconds, else if N=1024 that will be about 56 seconds. that is, the speed is very different.
2. "slice[j][i]=(float)(slice[j][i]+0.01)" is executed over two times faster than "slice[i][j]=(float)(slice[i][j]+0.01);". You can have a try by cutting off one of these sentences.
3. An exception will happen if "int i,j,k; float slice[N][N];" is moved into function main() that says "test.exe has encountered a problem and needs to close. We are sorry for the inconvenience.". In addition, my program is named by "test.cpp"
Have you known these problems?
and could you give me an explanation
and how to avoid these bad results
please
Any is appreciated!
Thanks!
|
|
|
|
|
1) With VC++6, and with VC++7(2002), I saw the same situation.
2) Regarding to
FlyingDancer wrote:
float slice[N][N];" is moved into function main()
please try this, since you use .cpp extension. It does not crash.
#include <iostream>
#include <time.h>
void main()
{
int i,j,k;
time_t start,end;
float s;
const int N = 1024;
float (*slice)[N] = new float[N][N];
start=time(NULL);
for(k=0;k<100;k++)
{
for(j=0;j<N;j++)
for(i=0;i<N;i++)
{
slice[i][j]=(float)(slice[i][j]+0.01F);
slice[j][i]=(float)(slice[j][i]+0.01F);
}
printf("%d\n",k);
}
end=time(NULL);
s=difftime(end,start);
printf(" The total time is %f:",s);
delete[] slice;
}
3) Regarding to 1024 taking that long time, I dunno. I guess that it may be the x86 instructions...
Maxwell Chen
|
|
|
|
|
Yeah
It can work well, not considering its run speed
Your way is to adopt an array pointer, that seems a little different
but what has been solved regarding to a big array slice[N][N] by adopting a array pointer?
This is a difficult problem, really. Is it related with OS, compiling way? Or maybe it is a memory allocating problem...
How do you think about this?
|
|
|
|
|
it crashes because if not allocated dynamically this array is allocated on the stack which probably can't hold 1024*1024*4-bytes...
|
|
|
|
|
Problem: "slice[j][i]=(float)(slice[j][i]+0.01F);" is executed faster than "slice[i][j]=(float)(slice[i][j]+0.01F);"
I think it should be answered from two aspects
1. In VC, A two-dimension array is stored according to its row first, then its col,...
2. Virtual memory technology. Paging and Swaping
In this problem every row of that array couldn't get enough free space
so when accessing to any data of another row a swapping action will happen
therefore one runs faster than the other
Am I right?
|
|
|
|
|
Maxwell Chen
|
|
|
|
|
1. I don't know, other than it's likely to be a virtual memory pathology.
2. This is your code,
<br />
for ( j = 0; j< N; j++ )<br />
{<br />
for ( i = 0; i < N; i++ )<br />
{<br />
slice [i][j] = (float)(slice[i][j] + 0.01 ) ;<br />
}<br />
}<br />
for ( j = 0; j< N; j++ )<br />
{<br />
for ( i = 0; i < N; i++ )<br />
{<br />
float * pf = slice + ( i * N ) + j ;<br />
*pf += 0.01 ;<br />
}<br />
}<br />
<br />
for ( j = 0; j< N; j++ )<br />
{<br />
for ( i = 0; i < N; i++ )<br />
{<br />
slice [j][i] = (float)(slice[j][i] + 0.01 ) ;<br />
}<br />
}<br />
for ( j = 0; j< N; j++ )<br />
{<br />
float * pf = slice + (j * N) ;<br />
for ( i = 0; i < N; i++ )<br />
{<br />
*pf += 0.01 ;<br />
++pf ;<br />
}<br />
}<br />
IOW in the first example you are asking the CPU to do an extra multiplication each time around the inner loop. The optimiser may be able to turn it into an addition (if that's faster...), but it's still extra work.
More subtley the second example accesses memory consecutively, so the data is much more likely to be in the CPU cache, whereas the first accesses every N * sizeof ( float ) bytes which means the next value will never be in the cache, accessing main memory means waiting about, accessing the cache puts that off, and since the cache is read and written to main memory in relatively large chunks you will get an entire 'cache line' of modified values going to main memory in the same time as it takes to write one.
Anyway it would be worth examining the generated machine code for each example to see what the optimiser actually does, and perhaps play with the options.
3. The default stack size for Win32 is 1MB. You are asking to allocate 4MB (sizeof ( float ) == 4 ) so the only way is to exit with an exception. You can adjust this in the linker, or with EditBin, but for a data structure of this nature either declaring it statically as in your example or allocation on the heap as in Maxwell's is appropriate.
Paul
|
|
|
|
|
Great!
Full and clear!!
Thank you very much!!!
|
|
|
|
|
I'd like to convert the C programs found in "Controling the world With Your PC" to Visual C++.Net programs. I have the dll for Win2000,XP and need sort of a starting point to the prodess. Ideas, tips? An exsample even ?
I did old QB & a little pascal. Got VB.Net and VC++.Net on the computer.
Thanks
Gyrogearloose
|
|
|
|
|
Any C program should run in VC++, including VC++.NET. What problems are you having ? The most likely one is that a project you create will have precompiled headers turned on, and you'll need to turn them off, or create a stdafx.h file and include it everywhere.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|