15,992,983 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Eugen Podsypalnikov (Top 200 by date)
Eugen Podsypalnikov
18-Dec-14 9:49am
View
Thank you :)
Eugen Podsypalnikov
10-Dec-14 3:21am
View
No, but the answer can be deleted
since it does not fit to your question :)
Eugen Podsypalnikov
10-Dec-14 2:43am
View
Sorry, it was not the subject of my answer :)
Maybe you will discover it...
Eugen Podsypalnikov
10-Dec-14 2:41am
View
You are right, in you case it is another list :)
Eugen Podsypalnikov
21-Nov-14 7:29am
View
Deleted
first class: virtual void Sort() = 0; // all methods may be also protected :)
third class: virtual void Sort() {...}
Eugen Podsypalnikov
17-Dec-13 6:06am
View
Deleted
As it already said: void pushElement(std::vector(int)& stack, int iElement) { stack.push_back(iElement); } :)
Eugen Podsypalnikov
13-Dec-13 4:31am
View
You are wellcome, Stefan :)
Now we know: "why ?" and "why not ?"
Ciao.
Eugen Podsypalnikov
13-Dec-13 4:26am
View
You and OP know
why it must be the same to the implicit form by Mr. Stroustrup
as well :D
Eugen Podsypalnikov
13-Dec-13 4:20am
View
Here is the answer for you, Stefan, and for OP:
The explicit form of the Standard copy constructor
MUST BE THE SAME to its implicit form, by Mr. Stroustrup :)
Eugen Podsypalnikov
13-Dec-13 4:07am
View
Are you meening
the implicitly implemented constructor by Mr. Stroustrup
in the class above, Stefan ? :D
Eugen Podsypalnikov
13-Dec-13 3:52am
View
// "Because Stroustrup said so" is not an Explanation
Realy ? I think so :) Please see below:
{
class A
{
int i;
public:
A() : i(0) {}
};
A a1;
A a2(a1); // Here is the hidden Speach by Mr. Stroustrup
}
All other links just use the Speach, not more :)
Eugen Podsypalnikov
13-Dec-13 3:31am
View
There is no explanation about any wrong Information, sorry :)
class B
{
public:
B();
B(const B&); // Why ? -Since it is a standard by Mr. Stroustrup :)
B(const B*); // Why not ? -Yes, you may do it as well :)
};
Eugen Podsypalnikov
13-Dec-13 3:25am
View
class B
{
public:
B();
B(const B&); // Why ? -Since it is a standard by Mr. Stroustrup :)
B(const B*); // Why not ? -Yes, you may do it as well :)
};
Eugen Podsypalnikov
13-Dec-13 3:22am
View
But it ("per pointer") may be an "own copy constructor" :)
Eugen Podsypalnikov
13-Dec-13 3:08am
View
I think Mr. Stroustrup is correct, it is the begin in my answer :)
Stefan is correct as well :)
And OP may use an own copy constructor per pointer, even so :D
Eugen Podsypalnikov
12-Dec-13 11:21am
View
I have answered the question of OP (please see it in bold above).
My code is just for the question part "Why not ?"
And the text - for the part "Why ?"
You can have many copy-constructors
but only one of them - Default Copy Constructor, by Mr. Stroustrup :)
Eugen Podsypalnikov
12-Dec-13 11:00am
View
I'm passing a comment above about some own copy-constructors as well :) :
class B
{
public:
B();
B(const B&);
B(const B*);
};
Eugen Podsypalnikov
11-Dec-13 10:18am
View
Try to include "stdafx.h" in sources (.cpp) only, like the CDTXBBAR.cpp case :)
The stdafx.h is unique for every project.
Eugen Podsypalnikov
11-Dec-13 9:57am
View
1. Is there "#pragma once" at the top of TextControl.h as well ? :)
2. Why is there '#include "StdAfx.h"' in a header ?
Eugen Podsypalnikov
11-Dec-13 8:17am
View
Because of the placement of std::map::insert(..)
The call can be in a function scope only.
The declaration of the map object may be global :)
Eugen Podsypalnikov
11-Dec-13 7:57am
View
It would be a "global" insert, before the object's usage in any functions :) :
class charMap : public std::map<char,char>
{
public:
charMap() {
insert(make_pair('{','}'));
}
} g_map;
Eugen Podsypalnikov
21-Mar-13 11:39am
View
It is good to know ! Thank you Stefan :)
Have you already tested the using of the "__forceinline" keyword
for a header inline function/operator - as well ?
Eugen Podsypalnikov
21-Mar-13 10:42am
View
Hi Stefan !
Could you test this model for the perfomance too ? :)
Eugen Podsypalnikov
21-Mar-13 9:17am
View
Maybe... It is just shown how to make an operator "pure" inline :)
Eugen Podsypalnikov
20-Mar-13 11:20am
View
// But Outlook crash when i try ti initialize _ApplicationPtr pApp
But... there is no any initializing here... :)
Eugen Podsypalnikov
20-Mar-13 9:04am
View
Hm... I have understood that you are thinking and wanting :)
Eugen Podsypalnikov
20-Mar-13 9:04am
View
Deleted
Hm... I have understood that you are thinking and wanting :)
Eugen Podsypalnikov
20-Mar-13 8:47am
View
The best way is your way... Of course :)
Eugen Podsypalnikov
20-Mar-13 7:59am
View
You are right ! The init part (list) must be injected firstly, if necessary :)
Eugen Podsypalnikov
20-Mar-13 7:59am
View
You are right ! The init part (list) must be injected firstly, if necessary :)
Eugen Podsypalnikov
20-Mar-13 4:04am
View
Probably in the same manner :)
class twoGlobalUints
{
static UINT& GetFirst()
{
static UINT uiFirst(0);
return uiFirst;
}
static UINT& GetSecond()
{
static UINT uiSecond(0);
return uiSecond;
}
};
// any.cpp
UINT test()
{
twoGlobalUints::GetFirst() = twoGlobalUints::GetSecond() = 11;
twoGlobalUints::GetFirst()++;
return twoGlobalUints::GetFirst() - twoGlobalUints::GetSecond();
}
Eugen Podsypalnikov
20-Mar-13 3:13am
View
// implement the copy operation here,
// same as in the assignment operator.
pre_iterator(const pre_iterator& __original)
{
*this = __original; // ;)
}
Eugen Podsypalnikov
19-Mar-13 9:55am
View
No, sorry, there is nothing more to chat for me :)
Eugen Podsypalnikov
19-Mar-13 9:04am
View
EXE-directory is the directory of "hw0-windows.exe"
I have copied the "shaders" directory and the "wood.ppm" file -
from your project directory int the EXE-directory, then started the "hw0-windows.exe" :)
The debugging (F5 from the VS solution) went just fine,
immediately after unrar and without any exception :)
Eugen Podsypalnikov
19-Mar-13 8:25am
View
WOW ! Very nice example ! Thank You :)
I have seen your teapot !!! :)
(just copy the directory "shaders" and the file "wood.ppm" into the EXE-directory)
Eugen Podsypalnikov
19-Mar-13 7:13am
View
// http://stackoverflow.com/questions/12329082/glcreateshader-is-crashing
Most likely :)
Eugen Podsypalnikov
19-Mar-13 7:02am
View
// what's story ?
A "story" would be the calling sequence including its used parameters :)
// what should i do ?
I would debug the code and then improve it :)
Eugen Podsypalnikov
14-Mar-13 12:00pm
View
OK, in this case the String must handle its ref/unref/clone needs by itself... :)
Eugen Podsypalnikov
14-Mar-13 11:25am
View
OK... Then we will need a memory manager for all such strings, to register and handle their references(inc/dec), sharing and modifing to/of the data :)
Eugen Podsypalnikov
14-Mar-13 11:24am
View
Deleted
OK... Then we will need a memory manager for all such strings, to register and handle their references(inc/dec), sharing and modifing to/of the data :)
Eugen Podsypalnikov
14-Mar-13 3:40am
View
// Do I need to use WM_SETFONT for every single control in every single dialog?
Please try it, for a single control. What is the result of this test, please ? :)
Eugen Podsypalnikov
13-Mar-13 3:31am
View
Hi Thomas !
Sorry, I have never used it too :
http://msdn.microsoft.com/en-us/library/windows/desktop/aa373163%28v=vs.85%29.aspx .
Eugen Podsypalnikov
12-Mar-13 7:14am
View
The UNICODE version of the solution may copy not all characters... :)
Eugen Podsypalnikov
7-Mar-13 9:28am
View
Hm... why not just the using of a temp file from a temp directory ? :)
Eugen Podsypalnikov
7-Mar-13 9:21am
View
Very likely... :)
Thank you !
Eugen Podsypalnikov
7-Mar-13 9:21am
View
Deleted
Very likely... :)
Thank you !
Eugen Podsypalnikov
6-Mar-13 10:27am
View
Yep, or :) :
BOOL CFlashingProgressBar::OnInitDialog()
{
BOOL bRes(CDialogEx::OnInitDialog());
SetTimer(EndDialogTimer,40*1000,NULL);
SetTimer(CounterTimer,5*1000,NULL);
return bRes;
}
Eugen Podsypalnikov
1-Mar-13 8:08am
View
Just try it, set a some region to a bordered window :)
See also: http://www.codeproject.com/Articles/31734/SonicUI-A-Convenient-GUI-Engine-You-ve-Never-Seen .
Eugen Podsypalnikov
18-Dec-12 2:56am
View
// worse cache performance, because things will be all over the place in memory
First - please remember that the all objects are in the memory (once or twice ;-))
I think, it (worse cache performance) is wrong :) ,
because a map will work with pointer- (or reference-) keys in its hash-table _more_faster_
as with full full-dumped-copies keys.
Above all, your code will be more canny (in the memory usage context).
Eugen Podsypalnikov
11-Dec-12 9:49am
View
Try it :) :
for (i = 0; i < _countof(abc); i++) {
//..
}
Eugen Podsypalnikov
11-Dec-12 5:59am
View
Some entries of the virtual functions table of an abstract class
can not be created by its owner object
(that is why "ISample aSample" would be an error for the compiler),
they must be defined by the derived objects.
The instances of the abstract classes
are only accessable per such derivations.
In C++, any not-private base-constructor's call
is possible from any its derivation-constructor :)
Eugen Podsypalnikov
11-Dec-12 2:55am
View
The daemon (in Windows - service) of the HW communication
could be started by the operating system up
and can provide an interface (OpenPort(), ClosePort(), ReadPort(), WritePort(), ..)
for a shell script's (terminal program) calls.
Here we have defined two SW-partners: daemon(1) and shell client program(2).
Eugen Podsypalnikov
11-Dec-12 2:43am
View
Maybe, I could :)
An abstract class (for example: an animal)
could hold the all centered data (age, weight, ... of an animal)
or centerd functions (get_age(), ...)
but not implement one or more of the "needed functions"
(for example: "go to", "jump to", "swim to", "say hello", ...).
Any "not abstracted" animal must reimplement the "personal" functions in its own manner :)
Eugen Podsypalnikov
11-Dec-12 2:40am
View
Maybe, I could :)
An abstract class (for example: an animal)
could hold the all centered data (age, weight, ... of an animal)
or centered functions (get_weight(), ...)
but not implement one or more of the needed functions
(for example: "go to", "jump to", "swim to", "say hello", ...).
Any "not abstracted" animal must reimplement the "personal" functions in its own manner :)
Eugen Podsypalnikov
11-Dec-12 2:31am
View
// my requirement is to use it as a daemon (by calling it from shell script)
That is an answer: your application could communicate with the daemon :)
Eugen Podsypalnikov
11-Dec-12 2:09am
View
// but the first one fails...
What code is it ? :)
Eugen Podsypalnikov
30-Nov-12 9:58am
View
Hm... :)
Now the function is visible for the compiler
and invisible for the linker :)
Try to transport it (its correctly form):
CString CFILicenseSettings::GetCodeStartup1()
{
...
}
into the file of usage (FIServerDlg.cpp ?)
then - try again :)
Eugen Podsypalnikov
30-Nov-12 9:52am
View
Now try to make an error inside the function's body,
for example: write "hello world" instead of "return".
Then try again, please, to see the output :)
Eugen Podsypalnikov
30-Nov-12 9:47am
View
Now try to remove your comments (make any changes)
and to compile the file from its context menu in the project tree:
can you see any output (at the output window) ? :)
Eugen Podsypalnikov
30-Nov-12 9:42am
View
Try comment the function itself in the FILicenseSettings.cpp,
not its call... :)
Eugen Podsypalnikov
30-Nov-12 9:38am
View
Have you the same linker error
if you comment its cpp-implementation ? :)
Eugen Podsypalnikov
30-Nov-12 9:27am
View
Can you see the function,
if you select "Open" in the file's context menu at the project tree ? :)
Eugen Podsypalnikov
30-Nov-12 9:21am
View
Can you compile the file from its context menu
(and see the output of #pargma error) ? :)
Eugen Podsypalnikov
30-Nov-12 9:15am
View
Can you see "Yes" in the entry "Excluded From Build"
in the general properties of the FILicenseSettings.cpp
(context menu for the file in the project tree) ? :)
Eugen Podsypalnikov
30-Nov-12 9:07am
View
=> the function is invisible for the compiler.
Have you some
#ifdef
or
#if
in the FILicenseSettings.cpp, above the function ? :)
Eugen Podsypalnikov
30-Nov-12 9:01am
View
Has the pragma (set it):
#pragma error
any compiling effect inside the function's body ? :)
Eugen Podsypalnikov
30-Nov-12 8:55am
View
...and how it (the function) is declared in its header ? :)
Eugen Podsypalnikov
30-Nov-12 8:51am
View
Are the (FIServerDlg.cpp and FILicenseSettings.cpp) files in the same project ? :)
Eugen Podsypalnikov
16-Nov-12 3:08am
View
OK :)
- then use an additional call of ::IsWindowVisible(hwnFound) after the hwnFound = ::FindWindow(..)
Eugen Podsypalnikov
16-Nov-12 2:31am
View
OK :)
- try to set the HWND variable to NULL before the second call of ::FindWindow(..)
- try to pass also the window class name (shown by Spy++) to the call of ::FindWindow(..)
- check that your searching window title is the same as the shown by Spy-tool (copy it there and then paste to your code)
Eugen Podsypalnikov
16-Nov-12 2:29am
View
Deleted
OK :)
- try to set the HWND variable to NULL for the second call of ::FindWindow(..)
- try to pass also the window class name (shown by Spy++) to the call of ::FindWindow(..)
- check that your searching window title is the same as the shown by Spy-tool (copy it there and paste to your code)
Eugen Podsypalnikov
3-Nov-12 16:12pm
View
As Jochen said, you could try to
- manipulate your manifest to provide the administrator rights for the application, or
- write a service started by the SYSTEM user and delegate such tasks to it
Eugen Podsypalnikov
2-Nov-12 6:42am
View
Good point for a classical base class,
not for the interfaces, which are nomally defined to hide the objects behind them :)
Eugen Podsypalnikov
1-Nov-12 14:52pm
View
What types of the variables and
what kind of the access (read/write) are wanted, please ? :)
Eugen Podsypalnikov
1-Nov-12 7:45am
View
Please post here the buttons code (their .rc or/and .cpp parts) :)
Eugen Podsypalnikov
1-Nov-12 7:40am
View
A refactoring of the code that you have could change the situation.
For example, you could pass a reference to an object of a matrix-class,
that could answer any question about its dimensions :)
Eugen Podsypalnikov
31-Oct-12 7:20am
View
In the current context (list of the structure-copies),
you have to iterate the list to find the needed structure firstly
(for example, it could be identified by a member inside the structure).
The searching process can be slowly ("magabytes of data") inside the list :)
That is why, you could also use a std::map<DWORD, MYSTRUCT*> as the data container
and then access a needed MYSTRUCT* by the using of std::map::operator[] :
void MyContext::EditById(DWORD dwId, int iNewValue)
{
MYSTRUCT* pMS(m_map[dwId]);
if (pMS) {
pMS->iData = iNewValue;
}
}
Eugen Podsypalnikov
30-Oct-12 18:15pm
View
Very understandable solution :)
Eugen Podsypalnikov
30-Oct-12 17:26pm
View
Yes, I have got inclination to write the structure destructor properly :)
http://www.codeproject.com/Questions/486436/Howpluscanplusipluspassplustheplusthisplusstlplusl
Eugen Podsypalnikov
30-Oct-12 15:52pm
View
3 stars - for three memory leaks :)
Eugen Podsypalnikov
29-Oct-12 12:35pm
View
// Will this imply that pointer->data variable will also be deleted?
- Yes, the pointer will be deleted, in its uninitialized case as well :)
// I seem to get a run time error in class A destructor once is being called in this code
- There is no call of ~A() in this (posted above) code :)
Eugen Podsypalnikov
29-Oct-12 2:57am
View
Only 3 as a help for the beginner :) :
- there is no explanation about the wrong used term "pointer to a member function"
- there are no deallocations in the provided code (= memory leaks)
Eugen Podsypalnikov
26-Oct-12 13:51pm
View
That's right, see also the reset-toolbar usage here:
http://www.wretch.cc/blog/kuolun1003/13910292 :)
Eugen Podsypalnikov
28-Aug-12 7:19am
View
Please look for example at the Windows File Explorer :) , there are:
- Directories pane (customers)
- File pane (customers orders)
- File preview pane (order details)
Eugen Podsypalnikov
21-Aug-12 9:00am
View
Sure :) , that is why you can see the "~cSon()" output. Try it without the keyword virtual in the base, and you will win a memory leak :)
Eugen Podsypalnikov
16-Aug-12 16:58pm
View
// When the status bar is first created, there are no strings to cancel
-- When the status bar is first created, m_nCount == 0, the loop will be not executed
// Reversing the two blocks of code solves that problem
-- Reversing the two blocks of code would produce memory leaks, at the second call
Good luck ! :)
Eugen Podsypalnikov
15-Aug-12 19:15pm
View
Please try the last solution, ist this that you wanted ? :)
Eugen Podsypalnikov
15-Aug-12 11:34am
View
Please try the update of the solution :)
Eugen Podsypalnikov
15-Aug-12 3:32am
View
Sure, it is a way :)
Eugen Podsypalnikov
15-Aug-12 3:27am
View
Yes, that is right :)
Eugen Podsypalnikov
14-Aug-12 16:16pm
View
// But if some other process has already written into xyz.txt file,
// how do i know if my xyz.txt file is corrupted or not.
I think, the traced time could answer this question :)
Eugen Podsypalnikov
14-Aug-12 9:28am
View
I will try it, see above :)
Eugen Podsypalnikov
14-Aug-12 9:27am
View
Deleted
I will try it, see above :)
Eugen Podsypalnikov
14-Aug-12 6:13am
View
Sorry, could not understand it from the first reading :) I will improve the solution...
Eugen Podsypalnikov
14-Aug-12 6:12am
View
Deleted
Sorry, could not understand it from the first reading :) I will improve the solution...
Eugen Podsypalnikov
14-Aug-12 3:50am
View
Nice, without some keys "virtual" as well :)
Eugen Podsypalnikov
13-Aug-12 16:35pm
View
Why in c ? :)))))
Eugen Podsypalnikov
18-Jul-12 11:09am
View
// then you don't need RPC at all
OK, thank you :)
I did not know about BE-LE relations and even about RPC as technique as well :)
Eugen Podsypalnikov
18-Jul-12 10:30am
View
// But the question is about RPC
You are right :)
Eugen Podsypalnikov
18-Jul-12 10:27am
View
// reimplement again when changing the structure
Why ? Only sizeof() will be recompiled... In case of an object the same serializing that is used for HDD exchange could do it... :)
Eugen Podsypalnikov
18-Jul-12 9:51am
View
// It is unstructured, and it deppends on the implementation
Yes, the serializing code must be known (shared) for both sides,
as it's shown at the Figure 2 in the link above :)
Eugen Podsypalnikov
18-Jul-12 9:46am
View
// This most likely first means that you will have to initialize COM
Yes, IStream is COM interface :)
Eugen Podsypalnikov
18-Jul-12 9:34am
View
// And marshaller knows nothing about how should be used an unstructured buffer
Why nothing ? The in-/out- code could be shared for both sides... :)
Eugen Podsypalnikov
18-Jul-12 8:05am
View
// Anyway, IStream is for serialization, but you need marshalling
IStream pointers can be marshaled by type library marshaling, and can be accessed by C++ clients (see the link above) :)
Eugen Podsypalnikov
17-Jul-12 11:13am
View
Yes, it can be equivalent to another loop :)
Eugen Podsypalnikov
17-Jul-12 10:54am
View
The copying after reallocation can take a loop as well...
My result is N^2 (+1 - for copying of the return value) :)
Eugen Podsypalnikov
4-Jul-12 15:28pm
View
// how its work ?
As OriginalGriff said,
the value will be read always from the address of the variable directly :)
Eugen Podsypalnikov
3-Jul-12 9:14am
View
You should debug the code to determinate its error line,
set a breakpoint there and execute it step by step... :)
Eugen Podsypalnikov
3-Jul-12 1:56am
View
Please post that error text here :)
Eugen Podsypalnikov
2-Jul-12 9:58am
View
// but what about bigger numbers like 3456 0r 4567
Very c00l ! Nearly all digits are the same ! 5ed :D
Eugen Podsypalnikov
2-Jul-12 9:30am
View
{ BUTTONINFO* pButtonInfo(new BUTTONINFO);
pButtonInfo->xPos = 12;
//..
pButtonInfo->szText = new TCHAR[80];
_tcscpy_s(pButtonInfo->szText,
_countof(pButtonInfo->szText),
_T("Hello world !"));
pButtonInfo->Length = 120;
//..
::SetWindowLong(hwnd, 0, (LONG) pButtonInfo);
}
case WM_DESTROY:
{
BUTTONINFO* pButtonInfo = (BUTTONINFO*) ::GetWindowLong(hwnd, 0);
delete[] pButtonInfo->szText;
delete pButtonInfo;
//..
}
break;
Eugen Podsypalnikov
1-Jul-12 14:21pm
View
Your structure and all its members should be allocated in heap.
When it could be passed to the SetWindowLong(..) function per its pointer.
After this action you can get its pointer per GetWindowLong(..) function.
Eugen Podsypalnikov
22-Jun-12 3:24am
View
In the context of your dialog:
bool bDroppedOnSrcBox(GetDlgItem(IDC_SRC_BOX)); // IDC_SRC_BOX is the resource ID of the box
bool bDroppedOnTrgBox(GetDlgItem(IDC_TRG_BOX)); // IDC_TRG_BOX is the resource ID of the box
Eugen Podsypalnikov
21-Jun-12 10:18am
View
Please do not try to call it (free(..)), just comment it out :)
Eugen Podsypalnikov
21-Jun-12 6:54am
View
// In MSDN it is written that, this function returns 0 on failure.
Please try it :) :
assert(12 == atoi("12 months"));
Eugen Podsypalnikov
21-Jun-12 2:11am
View
Take it :)
Eugen Podsypalnikov
21-Jun-12 1:55am
View
At your "dropped" event, call this test for the both boxes (pass their pointers). The function will return true, if a testing box is under the mouse :)
Eugen Podsypalnikov
21-Jun-12 1:50am
View
Hi Maximilien ! Yes, you will need IMPLEMENT_SERIAL instead, if your button has own persistent members and must be serialized dynamically by the framework, of course ! :)
Eugen Podsypalnikov
20-Jun-12 10:08am
View
Deleted
Please post your class declaration and the call of ReplaceButton here :)
Eugen Podsypalnikov
19-Apr-12 10:35am
View
Thanks,
I agree with you :)
Eugen Podsypalnikov
19-Apr-12 10:25am
View
Thank you ! :)
Eugen Podsypalnikov
19-Apr-12 10:05am
View
Thank you,
but I can not see any copy operation here, for <char> as well... :)
Eugen Podsypalnikov
19-Apr-12 2:45am
View
Thanks, 5-ed :)
Eugen Podsypalnikov
2-Mar-12 1:57am
View
For example:
(ACE)99, (P)1, (DF)99, (P)1, (ACE)1000, ...
could meen:
ACE-chord plays for 99 milliseconds, then
Pause for 1 millisecond, then
DF-chord for 99 milliseconds, then
Pause for 1 millisecond, then
ACE-chord for 1 second, then ...
Eugen Podsypalnikov
21-Feb-12 9:56am
View
OK :) Then please try it:
{
//..
CCreateContext cContext;
cContext.m_pNewViewClass = RUNTIME_CLASS(CConfigViewPlugin);
m_cYourSplitter.CreateView(.. , &cContext);
//..
}
Eugen Podsypalnikov
9-Feb-12 8:10am
View
Thank you,
but 3*(fWB * fWB) = (fR * fR + fG * fG + fB * fB) , isn't it ? :)
Eugen Podsypalnikov
9-Feb-12 7:47am
View
So the casting has just "extend" (incorrect)
the boundary of a smaller object by the data member of the bigger type :)
There could lie another application data,
but your test had a lucky end (not a low) :)
When you try to extend the smaller object by a float member as well,
the "casted" set method will set it (not the original member) :)
Eugen Podsypalnikov
9-Feb-12 7:06am
View
Hm... It was just an abstract example...
We could call it
as we want to add a sound file link to the collection...
Eugen Podsypalnikov
9-Feb-12 4:20am
View
static CStringArray arSoundFiles;
void CYourCode::AddSound(const CString& cszSoundFile)
{
arSoundFiles.Add(cszSoundFile); // :)
}
const CString& CYourCode::GetLastSound()
{
static CString cszNone;
if (arSoundFiles.GetCount()) {
return arSoundFiles.GetAt(arSoundFiles.GetCount() -1);
}
return cszNone;
}
Eugen Podsypalnikov
9-Feb-12 4:09am
View
Why not to hold a link to a sound file (instead) ? :)
Eugen Podsypalnikov
30-Nov-11 9:53am
View
// How can I make my C programm run faster and use less memory?
Is there a function in your C programm
that does make you not sure ? :)
Eugen Podsypalnikov
23-Nov-11 6:25am
View
Hm... A static instance in the server code could call the all connected clients by its destructor... :)
Eugen Podsypalnikov
7-Nov-11 2:29am
View
I would see the labor task (research only, probably your 1 up to 10 positions) to find out the k and d for the linear law: y = k*x + d ...where y is needed interpetation by the second program of the values x from the first program. Once they are found (in a labor(research) workaround), they could be used in the hard code of the second program (probably your 11 up to 13 positions) :)
Eugen Podsypalnikov
7-Nov-11 2:26am
View
Deleted
I would see the labor task (research only, probably your 1 up to 10 positions) to find out the k and d for the linear law:
y = k*x + d
...where y is needed interpetation by the second program of the values x from the first program.
Once they are found (in a labor(research) workaround), they could be used in the hard code of the second program (probably your 11 up to 13 positions) :)
Eugen Podsypalnikov
9-Sep-11 8:33am
View
Please, try to invalidate the bottom by resizing, overlapping, or minimizing/reparing :)
Is it then visible ?
Eugen Podsypalnikov
9-Sep-11 8:20am
View
Deleted
Then try it :) :
if( cScrollFlag == 'Y' ) // if scrolling required //
{
TextOut( hdc, cxChar, iVertPos - cyChar, szBuffer, lstrlen( szBuffer ) );
}
Eugen Podsypalnikov
9-Sep-11 7:58am
View
Have you already tried to scroll without the clipping (last two parameters =NULL) ? :)
Eugen Podsypalnikov
5-Sep-11 11:27am
View
You can try the Spy++ tool (inside the MS VS set) to observe the styles and the received messages (generated by the mouse, which - maybe - could be simulated by your code as well) of the child... :)
Eugen Podsypalnikov
5-Sep-11 6:41am
View
An int is not a CObject yet... :)
But you can control for example the VARIANTs in your list
or the pointers of CMyGenericValueBase. Then you could dirive some real values, for example CMyString : public CMyGenericValueBase and others... :)
Eugen Podsypalnikov
5-Sep-11 6:34am
View
...it is also comfortable to use a type predefinition, for example :) :
typedef CList<int, int> CIntEntries;
class CMyRegs : private CIntEntries
{
..
void Reset() {
//.. some leaving actions
//..
CIntEntries::RemoveAll();
}
};
Eugen Podsypalnikov
26-Aug-11 5:35am
View
Are you
using the LoadLibrary(..) function
or linking the DLL directly ? :)
Eugen Podsypalnikov
26-Aug-11 3:41am
View
Not sure, sory...
I think, only the drawing in the context of OnDraw(..) will "repare" the tracker after the scrolling :)
Eugen Podsypalnikov
26-Aug-11 2:52am
View
Would be QT thinkable for you ? :)
( http://www.youtube.com/watch?v=jfHM4pQSqt4 )
Eugen Podsypalnikov
26-Aug-11 1:43am
View
How is the Dll "attached", please ? :)
Eugen Podsypalnikov
24-Aug-11 3:37am
View
Hi Laxmikant Yadav,
the remaining bytes (in the processor registers) are not using in the second case.
This behavior (machine code) is the result of a (32- or 64-bit) compiler and its appropriate linker.
So a 64-processor can receive the 32- or 64-bit instructions (commands).
A processor is a HW part.
An OS or an executable file are SW.
The SW can be build by 32- or 64-compiler/linker.
It is also possible to provide (send) 32-bit instructions of an executable by a 64-bit OS on (to) a 64-bit processor. This process (of that executable) will take just a "shorter cord" for its (memory) space addressing :)
Eugen Podsypalnikov
29-Jul-11 4:45am
View
Deleted
Please look for "ES_READONLY" and "WS_DISABLED" in your *.rc file and remove them just for test :)
Eugen Podsypalnikov
28-Jul-11 7:21am
View
0. Probably you should increment i1 (i1++) instead i (i++)
1. See also at my modified first function: the count will be "serialized" as well
:)
Eugen Podsypalnikov
28-Jul-11 3:17am
View
Please see above :)
Eugen Podsypalnikov
19-Jul-11 4:29am
View
// call to force a specific doc/view to undock from the tab bar
I could find the versa-way only: a dock-pane can fly to the client area and back :)
(see the caption context menu at the "file view dock-pane" in the general wizard's example)
Eugen Podsypalnikov
13-Jul-11 6:41am
View
0. Thanks !
1. Try nSize *= 2 before its passing.
2. Please provide the returned value of wcstombs()
Eugen Podsypalnikov
13-Jul-11 6:35am
View
0. A "life" message from a client with its ID - once per one minute
and a "death" timeout for two - as a communication low ? :)
1. Try to hold the client's communication object as global static object
with the CreateInstance(..) in its constructor ant Release(..) in its destructor :)
Eugen Podsypalnikov
13-Jul-11 5:57am
View
What is a "connection" in your case,
why does it need any maintenance ? :)
Eugen Podsypalnikov
13-Jul-11 5:00am
View
Please provide your test code and the returned value :)
Eugen Podsypalnikov
6-Jul-11 10:48am
View
Try to find (or generate) an *.?dl (in my case an *.idl) file :)
Eugen Podsypalnikov
6-Jul-11 10:29am
View
Yes, I see it so (too) :) The COM+ is an extension (not a replacement) for the COM...
Eugen Podsypalnikov
6-Jul-11 10:23am
View
static const CLSID CLSID_MYLAYER = {
0x9912EF9F, 0x0FF0, 0x42c1, { 0xAE, 0x6B, 0x74, 0x0C, 0xC8, 0x3D, 0x6D, 0xA8 } };
static const IID IID_MYLAYER = {
0x03A1EE13, 0x2CB6, 0x4b79, { 0xA4, 0xF6, 0x40, 0x65, 0xBB, 0xBE, 0x9B, 0x2B } };
void CSomeUser::SomeStart(..)
{
// IMPILayer* m_pIMPILayer = NULL; // Interface' pointer
HRESULT hr = CoCreateInstance(CLSID_MYLAYER,
NULL,
CLSCTX_INPROC_SERVER,
IID_MYLAYER,
(void**) &m_pIMPILayer);
if (S_OK == hr && m_pIMPILayer) {
m_pIMPILayer->SomeMethodeCall(..)
...
}
}
Eugen Podsypalnikov
6-Jul-11 10:10am
View
Probably I would use some interface(s) of an COM+ object in the same (COM) way... :)
Eugen Podsypalnikov
6-Jul-11 9:54am
View
In general case
you could begin at CoCreateInstance(..) function :)
See also: http://www.jj54.com/73850-CoCreateInstance-Fails-On-COM-43-Object-With-Object-Construction-Enabled-And-No-Constructor-String-Present/
Eugen Podsypalnikov
6-Jul-11 9:39am
View
Then try to modify your free-function to the following form :) :
DYNLIB_API void fn1(int **p)
{
if (p) {
delete *p;
*p = NULL;
}
}
...and its call :
int main(int argc, char* argv[])
{
int *p=NULL;
p=new int(100);
fn1(&p);
return 0;
}
Eugen Podsypalnikov
6-Jul-11 9:26am
View
Already tried to use delete and not free ? :)
Eugen Podsypalnikov
6-Jul-11 9:17am
View
I would put the resul in rbbi.hbmBack at stake... :)
Eugen Podsypalnikov
10-May-11 6:41am
View
It is a variable, as your array's const-reference :)
It could be written also:
const cArrItems& items = doc->GetArray();
Eugen Podsypalnikov
10-May-11 5:00am
View
Just modify your usage like this :) :
const cArrItems& items(doc->GetArray());
Please note, that the const reference does provide the "const" access only.
So you will be not able to call the not const functions on such refernce...
Eugen Podsypalnikov
10-May-11 4:52am
View
Please post the both lines now:
- declaration of your function
- usage of your function
We will try to compare them :)
Eugen Podsypalnikov
10-May-11 4:41am
View
Please try to use the last posted function :)
Eugen Podsypalnikov
10-May-11 4:36am
View
Please post the declaration of the GetItems() function here :)
Eugen Podsypalnikov
10-May-11 4:27am
View
Please try it :) :
CTypedPtrArray <cobarray,coverlayitems*>& myArrayRef = doc->GetItems();
Eugen Podsypalnikov
10-May-11 3:45am
View
Please post the code line of the error here :)
Eugen Podsypalnikov
8-Apr-11 6:43am
View
You could try to implement your derived function :) :
void CDerivedOne::DoDataExchange(CDataExchange* pDX)
{
CSampleDlg::DoDataExchange(pDX);
}
Eugen Podsypalnikov
25-Mar-11 12:34pm
View
1) Then (0 == buff[0]), in other words the buffer's content is empty
2) You should try to subclass the edit box by your own control with its own reaction for WM_GETTEXT
3) A control does receive the WM_GETTEXT (LPARAM=buffer, WPARAM=its length) to fill the buffer out (it is an answer, so the customer of the text has no answer when the reaction does nothing (!))
4) ...says LPTSTR (not LPSTR)
Eugen Podsypalnikov
25-Mar-11 12:25pm
View
Deleted
1) Then (0 == buff[0]), in other words the buffer's content is empty
2) You should try to subclass the edit box by your own control with its own reaction for WM_GETTEXT
3) A control does receive the WM_GETTEXT (LPARAM=buffer, WPARAM=its length) to fill the buffer out (it is an answer, so the customer of the text has no answer when the reaction does nothing (!))
4) ...says LPTSTR (not LPSTR)
Eugen Podsypalnikov
16-Feb-11 1:38am
View
Yes, you could also pack your edited fields into a class, for example:
class CDataEntry
{
CString m_cszFieldA,
m_cszFieldB;
int m_iFieldC,
m_iFieldD;
..
};
...and then implement void CYourView::UpdateView(CDataEntry& cData); as well :)
The (any) DB-exchange (open/save/update/...) could be managed by the view only.
Sorry, I have not understood why you are saying about a DB-type switch (1),
and my DB-skills (speed/comfort/safety/...) are very poor (2)... :)
Eugen Podsypalnikov
14-Feb-11 1:58am
View
I do not know it yet, sorry.
Anyway I would try to exclude any "unneeded" rowsets concurrency...
The edited set by the dialog would be ready for the view directly, without any DB exchange :)
Eugen Podsypalnikov
26-Jan-11 17:33pm
View
Yes, it can :)
I was just attracted to the same "ready" type of the member and its get function... :)
Eugen Podsypalnikov
15-Dec-10 6:41am
View
Please check the redrawing
under the overlapping by a normal cmd-window shown by ist own (not a child) process... :)
(I would remove also the last two lines 'CloseHandle(..)' :) )
Eugen Podsypalnikov
15-Dec-10 3:14am
View
Understood. So you are looking for a library that provides the PNG-bits access, aren't you ? :)
Eugen Podsypalnikov
15-Dec-10 2:34am
View
Have you already tried it ? :) :
{
CImage cImage;
if (S_OK == cImage.Load(_T("C:\\transp.png"))) {
void* pBits = cImage.GetBits();
if (pBits) {
//..
}
}
Eugen Podsypalnikov
13-Dec-10 15:26pm
View
Please see the steps 6 and 7 here:
http://www.codeproject.com/KB/DLL/XDllPt1.aspx :)
Eugen Podsypalnikov
13-Dec-10 3:00am
View
A DLL does cover the executing linkage,
during a LIB - the building linkage (your fault case) :)
Eugen Podsypalnikov
22-Nov-10 16:43pm
View
The both sequences below are re-using the constructor code only not an object :) :
{
CArchive* pA(new CArchive(&f, CArchive::store));
...
delete pA;
pA = new CArchive(&f, CArchive::load);
...
delete pA;
}
bool CYourArray::ExchangeData(bool bLoad, ...)
{
...
CArchive ar(&f, bLoad ? CArchive::load : CArchive::store);
...
}
Eugen Podsypalnikov
4-Oct-10 1:45am
View
Hm... I thought, you know them :)
- Please validate your received hWnd and hToolbar by Spy.
- Try it (yours) also with the index 0 (the separators have their positions as well).
- Please observe the returned value by SendMessage(.., TB_GETBUTTON, ..)
- Try also the message TB_GETBUTTONINFO (set the field cbSize before you will pass a TBBUTTONINFO)
- Usually, the commands handling frame of a bar is its parent or the main window
- Does the window "Test window" lie in an external process (started by the same rights) ?
Eugen Podsypalnikov
30-Sep-10 8:35am
View
Thank you, Sauro ! :)
Eugen Podsypalnikov
30-Sep-10 5:16am
View
// newbie like me
http://www.youtube.com/watch?v=QgbntWU7pG8 :)
Eugen Podsypalnikov
28-Sep-10 12:20pm
View
Try also to transform your application to UNICODE,
it will be more comfortable :)
Eugen Podsypalnikov
28-Sep-10 12:14pm
View
0. OS->NonUnicodeLaguage=Russian
1. In your .rc file, opened as text:
...
/////////////////////////////////////////////////////////////////////////////
// Russian resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
#ifdef _WIN32
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)
#endif //_WIN32
IDD_RUSTEST_DIALOG DIALOGEX 0, 0, 320, 200
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION
EXSTYLE WS_EX_APPWINDOW
CAPTION "RusTest"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,209,179,50,14
PUSHBUTTON "Cancel",IDCANCEL,263,179,50,14
LTEXT "12,78 M/C",IDC_TEXT,54,53,57,24
END
STRINGTABLE
BEGIN
IDS_STRING129 "%.02f M/C"
END
...
2. in your .cpp :
GetDlgItem(IDC_TEXT)->SetWindowText("34,76 M/C");
or :
char szBuffer[MAX_PATH];
::LoadStringA(NULL, IDS_STRING129, szBuffer, MAX_PATH);
CString cszText;
cszText.Format(szBuffer, 12.98);
GetDlgItem(IDC_TEXT)->SetWindowText(cszText);
:)
Eugen Podsypalnikov
28-Sep-10 9:15am
View
The "text box" seems to be coded in CP1252 (not in 1251)...
Can you put _this_ string at a button there (at the surface) properly ? :)
Eugen Podsypalnikov
28-Sep-10 5:54am
View
Be also sure,
that your CMDIChildWnd::Create(..) is called after the ExeApp::MainFrame was allocated :)
Eugen Podsypalnikov
28-Sep-10 5:06am
View
...or try your model without any AFX_MANAGE_STATE, please :)
Eugen Podsypalnikov
28-Sep-10 4:58am
View
Please see the "second part" above... :)
Eugen Podsypalnikov
28-Sep-10 4:02am
View
Very good :)
Why do you want to use any managers (and AFX_MANAGE_STATE too)
and not just export/import your classes by DLL/EXE ? :)
Eugen Podsypalnikov
28-Sep-10 3:56am
View
But your combination EXE&DLL will need a main frame,
is there any frame at the exe-app ?.. :)
Eugen Podsypalnikov
28-Sep-10 3:55am
View
Deleted
But your combination EXE&DLL will need a main frame,
is there any frame at the exe-app ?.. :)
Eugen Podsypalnikov
25-Sep-10 7:35am
View
1) It would be OK, when the validity of the pointers is granted for the whole time their usage.
2)
class CCsTrendPoint : public CObject // a point's data
{
..
}
class CDisplayItems : public CObList // collection of CCsTrendPoint* for a pen, second dim
{
..
};
class CDisplayData : public CObArray // collection of CDisplayItems* indexed by pens, first dim
{
..
};
:)
Eugen Podsypalnikov
24-Sep-10 10:16am
View
An operator 'new' returns a pointer of the constructed typed object allocated in the heap. Such pointers are valid until they will not be deleted by the operator 'delete'.
Othersides, you can get any typed pointer by 'ampersand', for example: { int i = 2; int* pointer = &i; }. Such pointers are valid only for the live-period of their "master-variables".
So you can use '&trendpoint', only when you are sure the trendpoint's live period is long enough... :)
Eugen Podsypalnikov
24-Sep-10 1:44am
View
What is your simulation context ?
At a valid window handle,
you could try to post the messages WM_MOUSEWHEEL, WM_RBUTTONDOWN, ... :)
Eugen Podsypalnikov
18-Sep-10 15:06pm
View
// Except you never see y...
...and its address as well... :)
Eugen Podsypalnikov
18-Sep-10 14:55pm
View
It's correctly, the "cout << x" is "precompilled",
but the debugger shows the modified value of x... :)
See also:
const int iSize(3);
int iSize2(3);
int ai[iSize]; // OK
int ai2[iSize2]; // error C2057: expected constant expression
Eugen Podsypalnikov
13-Sep-10 8:53am
View
Please post your code here :)
Eugen Podsypalnikov
9-Sep-10 17:06pm
View
The address of test[5] does not lie at the integer-boundary,
the testptr can not be used to dereference its value directly on some systems :)
Eugen Podsypalnikov
9-Sep-10 9:11am
View
1. I have not used any term of a "pointer address", but one of a "pointer" :)
2. You can not "correct" an data address, but you can copy the addressed data :) :
{
char* szTestBuffer = "content";
WORD* pwData = (WORD*) &szTestBuffer[1]; // an odd address !
#ifdef _X86_
(*pwData)++; // it is OK on x86
#elif defined(MIPS)
// (*pwData)++; // it is not OK on MIPS
WORD wTemp(0); // an even address
memcpy(&dwTemp, pwData, sizeof(WORD));
wTemp++;
memcpy(pwData, &dwTemp, sizeof(WORD));
#endif
ASSERT('p' == szTestBuffer[1]); // :)
}
Show More