I am getting used to using cout, despite of its irrational behaviour.
In my main project I went overboard with debugging colouring scheme and it sort of works.
I just started the "client" part of the project and reusing a class from my main project where cout colouring and cout lines work just as expected.
In derived project - no coloring, cout lines have extra line feed and I am getting non printable characters to boot.
Just another bug to find.
I am finding out this setw does not always work....
I have a bitmap file of a red bullet Originally I tried to display it using RichEdit Ole Interface I copied the code modified it somewhat from
the "Q220844: HOWTO: Insert a Bitmap Into RTF Document Using RichEdit Control" I was able to display it however it didn't fit quite right
So I decided to go with a native Win32 and display on Static control adjacent to the rich edit
Thing is where the OleCreateFromFile worked the LoadImage API fails GetLastError return a zero as well using File Explorer I can see the red bullet
So much confusion and misunderstandings to know where to start.
Lets start with SetSel misunderstanding which starts at 0 NOT 1 it is a zero-based index.
Very important is the file type you didn't say what the file was look at the last 3 letters of the filename is it BMP, GIF, JPG or PNG?
Yes if you have a white border the white border will be on the image UNLESS it is a transparent image which needs a special header and depends on file format (so again we need the file format).
You said you change the code over to LoadImage and I warned you that you can only load files that are of BMP and PCX type. That is files that end with those 3 letters and have a proper matching header. If you try to load a wrong type it does pretty much what you describe returns NULL with a GetLastError of 0 because it can find the file but it's just junk it can't understand.
So can we at least get a filetype to start with so we know what we are dealing with, so 3 letter filename extension please. If you can't see them on windows go up to view settings and tick the box that says file name extensions.
I understand that LoadImage wont work, Let me ask the following if I use LineIndex(-1) then I am returned the char index on the line and its I ASSUME it is the first char index in that line that has the caret
Afterwards if I do GetCharPos using that value I get the x,y coordinates in pixels of that char so I would like to place my bullet there and x = 1 that it should lie all the way to the left of the rich edit control and yet its off (about 1/8 of inch) my only guess is when I display the bullet in paintbrush there is white rectangle around it
and that is what is pushing it off. what do you think
if this true would you know how I would go about getting a red bullet bmp/png like the breakpoint in Visual studio Debugger
I have an MFC application for which I have integrated OPC function using Wintech OPC DLL.
This application is an OPC Client which connects to a OPC Server and gets values from it using OPC communication.
I call the OPC functions in my application.
I used WPF(dll created by C#) in this application for some graphics and turned on the project
setting "Common Language Runtime Support (/clr)"
When I run my application in VS2008 using F5, it runs without any issues it shows correct values.
But when I run the same application using Cntrl+F5 or directly run the EXE, it runs but it shows junk values.
Suppose i change project setting from "Common Language Runtime Support (/clr)" to "No Common Language Runtime support" it is not supported WPF dll.
You will need to provide much more information before anyone can help you with this. You say that it shows junk values; what are those values and why are they junk? What is the code that produces them, and what input data is used to create the values in the first place?
As leon mentioned LoadImage may not work with .png files
I am trying to emulate Visual Studio Debugger Breakpoint, when I used the RichEdit OLE interface and look at the SetSel parameters I see the first value (The x value as 1) however is stands away from right edge of the Parent Dialog frame (maybe by 1/8 of inch).
Looking at the image in file explorer it looks just fine but when I am open the image in paintbrush I can see a rectangular white border around it and maybe that is part of the problem. If that is a problem would you have any suggestion for me how to get an image ie. red bullet, I picked this one up by doing a google search thanks
Are you sure variables are not initialized for a debug build when run with ctrl-F5? ctrl-F5 only implies that the code will be run without attaching the VisualStudio debugger. It does not mean the code will be run in release mode - there may not even be a release mode executable to run.
I do know that you can run a release build with F5, and when you inspect an uninitialized variable, it will most likely not show a null value, just as you described - but that does not depend on whether or not you attach a debugger.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
That means whenever you run the debugger the heap is different to normal unless you go thru the hijinx to turn it off which used to be as simple as _NO_DEBUG_HEAP = 1 but like everything it has gotten successively harder.
In vino veritas
Last Visit: 31-Dec-99 18:00 Last Update: 3-Oct-23 18:36