|
Oh, for the love of god! This makes finger-painting look like a fine-art.....
int radius;
POINT circleCenter;
RECT boundingRect;
boundingRect.left = circleCenter.x - radius;
boundingRect.top = circleCenter.y - radius;
boundingRect.right = circleCenter.x + radius;
boundingRect.bottom = circleCenter.y + radius;
|
|
|
|
|
manzoor10 wrote: enclosing rectangle for a circle
Actually it is a square (well, I know the square inherits from the rectangle ).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: well, I know the square inherits from the rectangle
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
Hi, I could not add a new .rc file to visual studio 2008 express edition, so I created a text .rc file and then added it using add existing item. That part worked okay. The resource folder now shows in visual studio 2008. BUT when I try to add files to the folder it tells me that the express version of the visual studio does not support resource file editing. Please help. How do I edit the resource file? Is there a way that I can create the resource script and it's files outside of the IDE? Please help!
|
|
|
|
|
Notepad! It's what I used to when programming windows 3 software...
You get an appreciation of the resources very quickly!
Or pay money for the grown up version... How much do you value your time?
Iain.
|
|
|
|
|
You may open the resource script as a text file inside the Visual Studio IDE . It is not difficult to edit it this way and you'll gain some insight.
Another option :
- Use
C# Express Edition to build up, visually, your GUI . - Develop a
C# program, exploiting the generated GUI (that is the C# code) to generate the corrensponding C++ resource script. - Write an article about, and post it at
CodeProject .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi @ all,
i´m recording speech with the capturBuffer of DirectSound.
Now I want to encode this in PCM recorded stream to a GSM Stream.
It is possible to do it with MS ACM?
Regards
Karsten
|
|
|
|
|
CrazyDogg wrote: It is possible to do it with MS ACM?
Definitely!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
That´s nice .
Can you tell me how?
|
|
|
|
|
CrazyDogg wrote: Can you tell me how?
Take samples from the DirectSound buffer and run them through ACM to
convert them to a GSM stream.
I would start here:
Audio Compression Manager[^]
These will be the most important functions you'll need:
acmStreamOpen()
acmStreamSize()
acmStreamPrepareHeader()
acmStreamConvert()
acmStreamUnprepareHeader()
acmStreamClose()
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You've worked with these Mark? I mean at work?
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
Definitely!
I've got a full working implementation using DirectSound for capture
and ACM for compression/decompression.
The GSM codec was the only built-in-to-Windows codec with a small enough granularity ("packet size")
for use with low latency real-time voice communication.
It works well, although I now use a different codec that's NOT implemented as an
ACM codec so the code is sitting dormant.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Heck I'm still not able to conclude the domain you are into! I think you'll load domains into your brain with few quick blinks of the eye - like Trinity learns to fly a helicopter. You should have got a rack of dvds labeld MEDICAL/NETWORKING/TELECOM/IMAGEPROCESSING.
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
VuNic wrote: MEDICAL/NETWORKING/TELECOM/IMAGEPROCESSING.
Just add DATABASE and that's it - everything I do
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Actually, I do very little image processing - that's all snake-oil "science"
MEDICAL/NETWORKING/TELECOM/IMAGING/DATABASE
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Okay I'm sending you 5 empty dvds...got burner?
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
Heh - OK.
Oh wait, DVD burner just broke right now...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
Hi All,
I am working on UDP sever module.I have developed a simple server for receiving and sending the data from a single client.
in "OnReceive()" handler only I am sending the data to the client using "SendTo()" function,
How can I extend this to multiclients.
Please give me an idea.
Plese provide me if anybody has the sample code.
Regards,
Sunil Kumar
|
|
|
|
|
Did I really needed multiple threads to handle UDP clients? Wait..scanning old dumps in brain.....oops, bad sectors. Search ends.
You are unlucky. let;s wait for someone to answer you.
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
Hi to all,
I am have written some classes in C++ as follows,
Class A
{
int b1Len; //count of B type objects in b1Collection
B *b1Collection; //stores collection of object of type B
int b2Len; //count of B type objects in b2Collection
B *b2Collection; //stores collection of object of type B
};
Class B
{
int cLen; //count of C type objects in cCollection //cLen is atleast 30
C *cCollection; //stores collection of object of type C
};
Class C
{
int d1Len; //count of D type objects in d1Collection //d1Len is atleast 140
D *d1Collection; //stores collection of object of type D
int d2Len; //count of D type objects in d2Collection
D *d2Collection; //stores collection of object of type D
int e1Len; //count of E type objects in e1Collection
E *e1Collection; //stores collection of object of type E
int e2Len; //count of E type objects in e2Collection
E *e2Collection; //stores collection of object of type E
};
Class D
{
int fLen; //count of F type objects in fCollection //fLen is atleast 2
F *fCollection; //stores collection of object of type F
};
Class F
{
int len; //count of characters in str //len is atleast 200
char *str; //stores multiple characters
};
int aLen; //count of A type objects in aCollection
A *aCollection; //stores collection of object of type A
DelAll(aCollection, aLen); //aLen is atleast 30
//it's a macro to delete array of objects of any type
#define DelAll(obj, no) if( obj != NULL ) { if( 0 < no ) { delete[] obj; obj = NULL; } }
I am using this macro in destructor of all class (above) to delete array of objects.
My problem is, it's takes atleast 0.86 secs
Is there anything wrong I am doing?
I am using VC++ 2008 as IDE.
Thanks & Regards,
Aniket A. Salunkhe
|
|
|
|
|
It'd be helpful if you post a working code. The above class structure and objects wont take too much time.
Please carefully check the destructors of the classes. You can roughly calculate the time using OutputDebugString API. Just start Debug View Tool and set the time to display in Milliseconds. then execute the code after putting enough log. or use some profiling or logging mechanisms to get the critical point.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Hi to all,
Thanks for your suggestions.
In every class I was using Add___() function to add object of other class.
I was reading a 35 MB xml & using that I was calling Add___() every time a found an object of class A, B, C, D, .. & I was getting problem at DelAll macro (it was taking more time to execute that might be due to lot of data).
Now I have replaced the Add___() function call, by it’s function body. Now it is taking normal time to execute DelAll macro
<br />
class A<br />
{<br />
void Add_B(const B* newBs, int newBsCount)<br />
{<br />
if( newBsCount <= 0 )<br />
return;<br />
<br />
B* temp_Bs = NULL;<br />
<br />
if( 0 < AllBsCount )<br />
temp_Bs = new B[AllBsCount ];<br />
<br />
int i<br />
for( i= 0 ; i < AllBsCount; i++ )<br />
temp_ Bs [i] = AllDays[i];<br />
<br />
DelAll(AllBs, AllBsCount)
<br />
AllBs = new B[AllBsCount + newBsCount];<br />
for( i = 0 ; i < AllBsCount; i++ )<br />
AllBs [i] = temp_Days[i];<br />
for( i = 0 ; i < newBsCount; i++ )<br />
AllBs [AllBsCount +i] = newBs [i]; <br />
<br />
DelAll(temp_ Bs, AllBsCount);<br />
<br />
AllBsCount += newBsCount;<br />
}<br />
}<br />
Thanks & Best Regards,
Aniket A. Salunkhe
|
|
|
|
|
(not really an answer)
Why are you using C type "collections" instead of std::vector (or std::list) ?
Are you checking the time in DEBUG or in RELEASE ?
I don't see much wrong in what you presented if the destructors are really deleting what has been allocated;
you probably have more data than you are expecting.
|
|
|
|
|
It looks like you have many arrays of objects, and a destructor is called for EACH array element. It may be possible to delete the whole array with one statement, if your destructor is just freeing memory (as opposed to executing cleanup code).
For example:
D* dArray = (D *) malloc (numberOfDObjects * sizeof (D));
...
delete [] (char *) dArray;
This invokes delete once, rather than numberOfDObjects times. You may be able to use similar logic for arrays of arrays of objects.
|
|
|
|