|
John502 wrote: At What Conditions,
CStudioFile::ReadString() Gives/Returns the FALSE value
According to the documentation:
Return Value
A pointer to the buffer containing the text data. NULL if end-of-file was reached without reading any data; or if boolean, FALSE if end-of-file was reached without reading any data.
John502 wrote: In a File Consists the Lines In one Condition "m_pString" doesn't take the line in the File?
Not sure what that means. Could you re-phrase that question?
Go and never darken my towels again - Groucho Marx
|
|
|
|
|
hello sir,
I know that,(i.e)already in the MSDN ,
AnyBody Know the another Conditions Please,
Tell me.
|
|
|
|
|
how to compare two frames of any media file in vc++
|
|
|
|
|
what do you mean by "compare" ?
|
|
|
|
|
it depends on how you represent the decoded frames. It can be by BITMAPINFOHEADER like structures..
|
|
|
|
|
Assuming you mean video frames, you could do something like this:
convert both frames to a common format (same number of rows and columns, same pixel format for example RGB15)
pixel by pixel, compare the red, green, blue components and check that they are "close enough"
If a "high enough" percentage of pixels match, the media frames match
This method will fail to return a match for all sorts of reasons, for example, because one frame has been cropped or because one frame has been processed to adjust the contrast, etc.
Really, what you need to do is figure out what tineye www.tineye.com[^] are doing.
|
|
|
|
|
Hi All,
I am trying plot a graph from MFC dialogbox. I have the datas from text file.
How to draw a graph using this in VC++ MFC?
If any there is control available on MFC?
how i can draw the graph?
Regards
M.Mathivanan
|
|
|
|
|
You already asked this question yesterday and I gave you a link to a chart control[^] that developed. Did you look at it ? What's the problem with it ?
|
|
|
|
|
Hi all,
i m using excel automation to write excel file.
everything is working fine but when i insert date and time value in excel sheet it not displayed in proper format.
i m inserting date and time value in this format
"Dec 16, 2010 06:17:00 PM" but it display in this format "16/12/2010 6:17:00 PM" and also if date and column width is small it display only # here.
please tell me how can i insert the date and time value to show in same format in excel file.
thanks in advance.
|
|
|
|
|
You need to set the format for the column to display the time in the way you want, and the width of the column to display all its content. The # string merely indicates that the column is not wide enough for Excel to display its content.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Richard MacCutchan wrote: You need to set the format for the column to display the time in the way you want
please tell me how can i do this?
|
|
|
|
|
Le@rner wrote: please tell me how can i do this?
Check the options for cell properties in the documentation; I suspect that the actual details may vary depending on which version of Excel you are using.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
No how can set it from vc++ code.
|
|
|
|
|
As I said above check the documentation[^] for the exact details.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Hi,
with this Excel .NET component you can easily do this:
Here is a sample Excel C# code (managed C++/CLI shouldn't be much different):
var ef = new ExcelFile();
var cell = ef.Worksheets.Add("Sheet 1").Cells[0, 0];
cell.Value = new DateTime(2010, 12, 16, 18, 17, 00);
cell.Style.NumberFormat = "mmm dd, yyyy hh:mm:ss AM/PM";
ef.SaveXls(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "DateTime.xls"));
|
|
|
|
|
Hi All
I read some text book .When we write definition of function in .h file.It's automatic a inline function consider by compiler. Though what should be exact size of Inline function.?
MACRO:It is parsed by processor.
what is difference between Inline and MACRO as speed and execution?
Thanks
|
|
|
|
|
inline is now mostly a hint to the compiler; but it decides whatever it wants to do with the code anyway; in general, inline method should be as small as possible and do as little as possible (get/set, simple calculations, ... )
In experience, we kind of stopped using the inline keyword in most new code.
Macro are evil.
Macros are processed by the preprocessor; it mostly will do a "textual" substitution (very liberal explanation!) of the macro to the actual code and then it will be compiled normally.
Macros are not debuggable; meaning you cannot put a breakpoint in it.
As for speed, I would say that for simple macro and simple inline methods the compiler and optimizer will make them more or less even.
You will have to check for particular test cases in your code to check performance issues.
In experience, we stopped using macros (except few particular cases) in new code and try to replace the ones in old code with methods or free functions.
Watched code never compiles.
|
|
|
|
|
Though why we use MACRO and INLINE? or what is advantage of it.
Is it right way to make general function instead of inline or MACRO?
|
|
|
|
|
GAJERA wrote: Though why we use MACRO and INLINE? or what is advantage of it.
You're really comparing apples to oranges. While you can make the #define preprocessor directive look like a function (e.g., min() , max() , HIWORD() ), there's nothing functional about it.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
GAJERA wrote: When we write definition of function in .h file.It's automatic a inline function consider by compiler.
This does not make sense, a function definition is merely a hint to the compiler so that it can generate the correct code for a function call in the code. It has nothing to do with either inline or macros.
GAJERA wrote: what is difference between Inline and MACRO as speed and execution?
They are totally different beasts so you cannot compare them. The inline keyword tells the compiler to generate the code 'inline' rather than via a function call. A MACRO is used to generate (possibly) different source language from parameters in the macro call. The modified source is then compiled to object code and may be inline or include function calls.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
GAJERA wrote: When we write definition of function in .h file.It's automatic a inline function
No it's not - if that's what your book said it was probably written by Herb Schildt and should be consigned to the bin. There are two ways of getting a function expanded inline:
- explicitly qualify it's definition with the inline keyword
- define a function in the body of a class
In both cases it's at the discretion of whoever wrote the compiler. If their cost/benefit analysis reckons there's no gain to be had by inlining the function the compiler won't do it. [Likewise there's no reason why a compiler and linker can't conspire to do inlining across modules - VC++ has done that for years...]
Personally I only ever use inline functions when writing templates, otherwise I don't bother so the size of the functions that may or may not be inlined is a problem for someone else. Likewise with macros - I only ever use them if there's no other option within the programming language. Inline functions are usually a better bet as they're processed by the compiler and it can give you far more meaningful error messages than the preprocessor does. Execution speed wise it's impossible to say in the general case.
Ash
|
|
|
|
|
The Macro is dealed with the preprocessor, it is only text replace. Because the C language does not have const keyword. so coder uses the Macro to define the const. And the function defined too. The head file can use #define to define a macro to forbide one head file included more than once in a project. Now the Visual studio 2005 can use #prama once instead of it.
The preprocessor cannot check the Macro type. so some error happens because for the Macro.
The inline can let function defined inside class.
Because one function called, it need to do jump, push stack, pop stack operations. So if some function simplely processes data and is called frequently, you can define this function as inline function to reduce the time used to call method. The incline funciton will be expansion by processor in the function called position. After compiled, you cannot find the inline function name.
I use inline function to cout the size of a struct.
About the speed, I donot test which is more quickly. But the c++ suggests not to use the macro. It often leads to error.
|
|
|
|
|
I would like to make a shortcut key combination to output test.
I have not had any luck finding any example code.
I know how to send text to the clipboard, but I have 4 sets of different text
that I want to use.
For example Ctrl Alt I would send "PPPPP is a good plan" to a storage area where I could
do a Shift Insert to place the text in an open document.
I have a list of Windows Shortcut keys so I would not "tromp" over those combinations.
Can someone help me?
Thanks.
|
|
|
|
|
Here is something you could try.
Use RegisterHotKey to register the shortcut keys.
Remember to specify a handle to a window as the first parameter.
When the windows receives the WM_HOTKEY message, use WM_SETTEXT to send a text to the active window.
You can use GetForegroundWindow to get the window with which the user is currently working.
|
|
|
|
|
I have been doing MFC coding. I am learning to do some STL lately, which Template project is the best for STL coding? is it ATL?
Thanks
|
|
|
|