|
You will need to subclass the window
|
|
|
|
|
|
Hello
In addition to what has been said, Here is an article about Subclassing[^]
Regards
|
|
|
|
|
i wrote the same code both in VISUALL C++ AND C#. in both cases, the OPTIMIZED SWITCH is turned on. the results: in C#, around 300 msec, in c++ less then 1 msec.
what is happening here??? in general i need to process 4 megabyte each 250 msec, and it looks likt c# is not the answer... or maybe there is another optimize switch in c# i am not aware of (beside the one in the BUILD TAB). can someone please advice? is it true c# is not good for real time?
THE CODE in visual studio 2005 c#:
===================================================================================
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics ;
namespace ConsoleApplication10
{
class Program
{
static void Main(string[] args)
{
byte []byte1=new byte[2097152*2];
byte[] byte2=new byte[2097152*2];
Stopwatch sw=new Stopwatch ();
sw.Start ();
for(int i=0;i<2097152*2;i++)
{
for(int y=0;y<64;y++)
{
if(byte1[y]==byte2[y])
//if (*(bytes1+i)==*(bytes2+i))
{
}
}
}
sw.Stop ();
Console.Write ("{0}",sw.ElapsedMilliseconds ) ;
Console.ReadKey ();
}
}
}
THE CODE IN VISUALL C++ 2005:
===============================
#include "stdafx.h"
#using <system.dll>
#using <system.drawing.dll>
#using <system.windows.forms.dll>
using namespace System;
using namespace System::Diagnostics;
using namespace System::Windows::Forms;
using namespace System::Drawing;
using namespace System::Drawing::Drawing2D;
int _tmain(int argc, _TCHAR* argv[])
{
char *bytes1=new char[2097152*2];
char *bytes2=new char[2097152*2];
Stopwatch^ stopWatch;
stopWatch = gcnew Stopwatch;
stopWatch->Start ();
//for (int u=0;u<10000;u++)
for (int i=0;i<2097152*2;i++)
{
for (int y=0;y<64;y++)
{
if (bytes1[y]==bytes2[y])
//if (*(bytes1+i)==*(bytes2+i))
{
}
}
}
long ii;
ii =(long)stopWatch->ElapsedMilliseconds;
stopWatch->Stop ();
printf("%d",ii);
//ElapsedMilliseconds Ticks
return 0;
}
|
|
|
|
|
Hi i am a chiptuner that programs my own software for cars..
Now i want to start writing small interfaces and checksumm algorytm, and i have just started to look at the visual c++
Anyone that can help me getting started with this?
I look forward to getting started
Thanks for all help
Regards
Frank
|
|
|
|
|
Where do you want to start? The first thing I sugest you do is get a C/C++ compiler. I hear Microsoft allows one version of Microsoft's Visual Studio to be freely downloaded... try to find if it is true, and if it is then go for it.
Then I would focus on what you will want to do. For interfaces I recommend MFC (because you are into C++, because if you were into C# I would recommend .NET). For checksum algorithms... I suspect you already know what you want the applications to do, right? Checksum algorithms, in C/C++, should come after you are comfortable dealing with memory, pointers, and the like. For that I recommend you read "Teach Yourself C++ in 24 hours". It is a very good book, and it took me 24 hours to read!
Then, at some point, I guess you will want to work with disk files, and serial ports (to send data out of the PC). If this is the case then don't worry, C/C++ and Windows allow very easy access to disk files, and Windows allows easy access to the serial port.
I sugest you come back with specific questions after you get through the first steps: getting a compiler and reading a book (or equivalent web tutorials, if you are not new to programming).
I hope this helps,
Rilhas
|
|
|
|
|
Hi Rihas
Thanks for the replay
Yes you are right.. there is a free fully version for 90 days.
And first is problem that you need to find out of the program visual c++.
I have started to look on it and it looks very interresting.
Where did you buy the book?
Frank
|
|
|
|
|
Hi,
In my application the dialog is set with the background bitmap .I have some buttons in that dialog.Now how can i make the button look flat and should mix with the background of the dialog window i.e,it should not resemble as a button and it should resemble just like a static text.
Thanks in advance,
Radhika.
|
|
|
|
|
You need to make button owner drawn.
see this[^]article to get some help.
|
|
|
|
|
I need to calculate distance (along curver) between 2 points on an ellipse.
I can not find answer from google.
do you still remember the math, or any links?
thx
|
|
|
|
|
|
Hi!
I need to process both ascii and chinese chars to 2 bytes? How do i do that? They are both stored in std::string. Please give an example.
Thanks very much!
|
|
|
|
|
when you say 2 bytes do you mean wchar_t data type? Use the MultiByteToWideChar() function. Although I very often have problems with chinese characters being mapped into two wchar_t characters. Make sure to specify the correct codepage.
|
|
|
|
|
How to specify the correct code page?
|
|
|
|
|
936 = Chinese Simplified
950 = Chinese Traditional
I should also tell you that there are two functions to do this. The one I told you MultiByteToWideChar() takes a codepage, but the second function mbtowc() only takes the strings. I usualy have many probles with the first function, instead of mapping a single character to 1 wchar_t , it instead splits it to 2, which is not unicode. The second function has never failed me. I suggest you try both of them.
|
|
|
|
|
about template
i create template class
<<<<<m_templatedata.h>>>>>>>>
template <class t=""> struct CTDbNode
{
T Data;
CTDbNode(T Value):Data(Value){}
};
<<<<<<<m_templatestructure.h>>>>>>>>>>>
#pragma once
#include "m_TemplateData.h"
template<class t="">class CTDbList
{
public:
CTDbList()
{
pCurrent=NULL;
}
void CTInsert(T Value)
{
pCurrent=new CTDbNode(Value);
}
public:
CTDbNode<t> *pCurrent;
};
example
CTDbList<cstring> d;
d.CTInsert(_T("ddd"));
error:
e:\mystudio\project\shared\shared\m_templatestructure.h(12) : error C2955: 'CTDbNode' : use of class template requires template argument list
e:\mystudio\project\shared\shared\m_templatedata.h(15) : see declaration of 'CTDbNode'
e:\mystudio\project\shared\shared\m_templatestructure.h(11) : while compiling class template member function 'void CTDbList<t>::CTInsert(T)'
with
[
T=CString
]
e:\mystudio\project\shared\shared\cm_selectquery.cpp(6) : see reference to class template instantiation 'CTDbList<t>' being compiled
with
[
T=CString
]
e:\mystudio\project\shared\shared\m_templatestructure.h(12) : error C2514: 'CTDbNode' : class has no constructors
e:\mystudio\project\shared\shared\m_templatedata.h(15) : see declaration of 'CTDbNode'
thank
|
|
|
|
|
Tick the "Ignore HTML tags in this message" button when you post: none of the the "<" or ">" characters can be seen in you post and it's poorly formatted.
Steve
|
|
|
|
|
I'm using a CFile to write to a binary file, and I want to modify some text in it. I would like to know if there is another way then rewriting everything after the position of what i want to modify(by modify i mean that it's probably be longer text). I tried the modeReadWrite to rewrite everything after the position, but for an unknow reason it doesent want to read anything(even in shareDenyNone). I even tried to make two CFile objects, one for reading and another one for writing and it still doesn't work. If you have any idea, please let me know.
|
|
|
|
|
nobody can help me
|
|
|
|
|
Has anyone found a way yet to comprehensively parse a CPP Decorated name, to recover the Original Declaration.
LateNightsInNewry
|
|
|
|
|
That depends entirely on the compiler being used. Here's[^] an article on the name mangling scheme in Visual C++. I don't know how correct it is, but I assume it is. I've seen the mangling scheme before in material published by Microsoft (can't remember where though, sorry!).
--
Transmitido en Martian en SAP
|
|
|
|
|
|
I want to know is it possible to to make a constant variable to hold a value the user of my application at the run of the program choose and i want him to not not chang it again.
thank you
******************
******************
** Ahmed Ismail **
******************
******************
|
|
|
|
|
Ahmed Ismail Mohamed wrote: I want to know is it possible to to make a constant variable to hold a value the user of my application at the run of the program choose and i want him to not not chang it again.
const is an official C++ qualifier.
|
|
|
|
|
but i think that a pointer have the address of const var can do changes, but when i make that i failed
Ahemd Ismail
|
|
|
|