|
I have a program that when compiled must remain the same. I am using preprocessor directive to make some significant changes to the program. Where I have been stumped is in the icon changes. I have managed to get all the icons within the application changed and the one's on the toolbar and all.
I am having to force the changes to the taskbar icon and Alt-Tab at compile time manually because I cannot figure out how to change them. I have not figured out how to change the icon on the right click properties menu on the application from explorer.
Basically I have 2 programs in one project. Each with seperate icons and program names. I have not been able to figure out how to change the icons in the second program at compile time.
Can anyone help?
|
|
|
|
|
|
Is there any programmer that wrote any program for Advantech DAC (PCL810HD series)?
Please help me!!!
A. Riazi
|
|
|
|
|
good day!
still trying to custom paint CEdit borders, it's working more or less ok now, but I'm having problems with coordinates (rect) of my control, and where I paint.
This is what I do now, it does work when the CCustomEdit is in a dialog without any border, my main "target", but now I have to use this in other dialogs, and the clientRect is wrong, the conversion is not good, and does not take into account the dialog borders (caption, borders, ... ).
What is the proper sequences to get the CEdit rect ( in the dialogs coordinate ) and Inflate it to fit the CCustomEdit rect ?
The target look is to have the border around the CEdit.
void CCustomEdit::OnNcPaint() <br />
{<br />
CDC* pDC = GetParent()->GetWindowDC();<br />
<br />
CRect windowRect;<br />
GetWindowRect( windowRect );<br />
<br />
CRect clientRect;<br />
GetClientRect( clientRect );<br />
<br />
ClientToScreen( clientRect );<br />
GetParent()->ScreenToClient( clientRect );<br />
<br />
clientRect.InflateRect( 2, 2, 2, 2 );<br />
pDC->FrameRect( clientRect, &m_BorderBrushFocus );<br />
<br />
ReleaseDC(pDC);<br />
<br />
}
Thanks.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
I emailed you a little demo app that shows how to do this using OnNCPaint() , OnNCCalcSize() , and PreSubclassWindow() .
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
hey guys, I am trying to get an idea of how I can write functions in C++ which can be used by visual basic 6 programmers.. anyone have any suggestions on where to get started? i have seen how dlls work looking at the introduction to com article, but that dll doesnt seem to work in vb, keeps giving me 'can't fint dll entry point' errors..
im also considering switching to c#, is it easier to write dlls in c# that to learn how to in c++?
if i could just have one example that would work in vb that would help so much.. anyone got any links?
thanks a bunch!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
See if this helps
in some .h file
long __stdcall GetAccountCodeFromAccountNumber(char*, long);
in your .cpp file
long __stdcall GetAccountCodeFromAccountNumber(char* caAccountNumber, long nCharacterCount)
{
long nReturnValue = 0;
.. do what ever you want kinda stuff.
return nReturnValue;
}
what's needed in the VB program
Public Declare Function GetAccountCodeFromAccountNumber Lib "TradeInput.DLL" ( ByRef AccountNumber as String, ByVal AccountNumberLength as Long ) as Long
Dim AccountNumber as String = "123456";
Dim AccountNumberLength as Long = 6;
Dim AccountCode as Long = GetAccountCodeFromAccountNumber(AccountNumber,AccountNumberLength);
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
i tried what you have here, but unfortunately im still getting my Run-time error 453 - Can't find DLL entry point GetAccountCodeFromAccountNumber ...
i tried what goes in the .cpp file both with and without the class name preceding the GetAccountCoddeFromAccountNumber(char*... but it didnt make a difference.. im going to try to create a new project (instead of using the one in the introduction to com example) .. what type of project should i select? MFC DLL im assuming.. ill let you know if that does anything for me..
thanks for the example!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Sorry, I did that too quickly. You also need to export the function.
in the .def file
EXPORTS
...
GetAccountCodeFromAccountNumber @99
...
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
You are the man Chris Meech! Thanks fer helpin me out!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Hello all!!
I will open a simple text file in MDI or SDI Project.
can somebody help me how i do this.
THX.
|
|
|
|
|
All you need to do is create a SDI or MDI of type CEditView... Then click the open button or from the menu and point it to a text file..
|
|
|
|
|
THX for your fast answer RobJones!!
|
|
|
|
|
Hi there everyone,
I will be very grateful to get any clue/direction about a problem, which I have on the last couple of days:
How can I transfer a rough audio buffer to an audio streaming, I have looked at the sample of this subject in the MSDN and I saw a sample which works properly only with WAV file – I want to check it with a buffer.
Thanks and Regards,
Eyal
|
|
|
|
|
Hello,
it's obvious that I don't free some memory that it's getting occupied again and again till everything blowns up...
The fact is that I've searched for all the "new"s in my project and all of them have their respective deletes...
Is there any way to detect what is happening and where?
would the memory be occupied also by SelectObject if I wouldn't delete the returned pointer?
NOTE:
is important to solve the problem becaus the VC++ program is intended to control a mechanical machine that will work 24 hours a day 365 days per year...
Thank you in advance.
|
|
|
|
|
I'd reccomend you get hold of BoundsChecker - that's a great app for tracking down memory leaks
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
another cause can be your serialization..
if you are reading in during serialization and have any 'new' keywords you could get a memory leak if your loading serialization is called multiple times without deleting what was created the previous time the data was serialized.. i know that was my problem once..
if not then i dunno try searchin for 'delete' in this board and you will come accross a bunch of ppl who have had memory leaks.. including me
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
|
You might want to check out MemWatcher[^].
It's not a developer's tool, but it can help keep your PC running smoothly over long periods of time by freeing up memory that Windows thinks is in use. It works especially well on Win9X and ME which frequently "runs out of memory" when it shouldn't.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I've got some RAW images and I have to open and process them: so I thought it was a good idea to get them and load them into CBitmap objects, in order to use MFC GID function, instad of readin each pixel with two FOR cycles.
RAW images have no header and they are 35MB large, I've tried this way:
*) CFile file;
*) BYTE* pData = new BYTE[fileSize];
*) file.Open(path, CFile::modeRead);
*) file.ReadHuge(pData, fileSize);
*) file.close();
*) m_bmp.CreateBitmap(m_BmWidth, m_BmHeight, 1, m_BmBpp, pData);
Variables are class attributes.
Debugging the code, is like I can't get the CreateBitmap method working.
|
|
|
|
|
1. RAW (almost by definition) has no specified format. it's usually the 'raw' uncorrected data dump from a CCD, scanner or some other device, in some undocumented format, not meant for your use.
2. CreateBitmap expects the data to be in a specific format, one which .RAW almost certainly doesn't conform to. (specifically, word-aligned pixel rows, probably with bottom-up scanlines and in BGR/BGRA channel order for 24/32 bpp images)
your best bet is to try to find out the format that your particular "RAW" image uses (good luck, and don't assume it applies to every other file with a .RAW extension), parse it into the format that CreateBitmap expects (32-bit RGBx is probably the easiest). then, you might get an image, though it will likely be in some color space (maybe logarithmic RGB , for fun) that you'll need to post-process. and, the image might need color balancing, color correction, sharpening, scaling, etc. before it looks like any kind of reasonable image.
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
So I have to scan the whole 35MB with two FOR cycles, bulding my matrix?
|
|
|
|
|
yes, unless by some wild coincidence, the format of your particular .RAW file is the same format the CreateBitmap wants.
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
When using CRichEditCtrl, you can catch the ENM_CHANGE message when you want to be notified of text changes.
But, I'm using CRichEditView inside an MDI-application. How can I get notified of text changes?
I don't want to catch WM_KEYUP cause then I have to catch all events like WM_LBUTTONUP, WM_RBUTTONUP, drag&drop events, copypaste events, ...
And when I want to add a message/event handler, there's no such thing as a ENM_CHANGE event.
using: [VISUAL STUDIO 6.0 sp5] [WIN98/2]
|
|
|
|
|
You should look for the EN_CHANGE notification. The ENM_CHANGE flag is used in conjunction with EM_SETEVENTMASK message to let the rich edit control you want to receive EN_CHANGE notifications.
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|