|
gnanapaul wrote:
it is not working.
No surprise, as it's a disaster in the making. You can't add/change items and delete other items in the same loop. When an item is deleted, all other items below that one get renumbered. If you insist on doing it this way, change the for() loop to be:
for (int i = 9; i >= 0; i--)
{
m_lstctrl.SetItemText(i, 0, value);
m_lstctrl.SetItemText(i, 1, value);
m_lstctrl.SetItemText(i, 2, value);
if (m_usrDia == value)
m_lstctrl.SetItemText(i, 3, value);
else
m_lstctrl.DeleteItem(i);
}
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hello,
I opened a multiband(band number>3) tiff image with gdalopen(). Then, use gdaldataset::getrasterband to get 3 bands as RGB bands to create a bitmap. And i use stretch to draw the bitmap in view class.
For most multiband tiff images, the image shown on the screen is identical to that opened by commercial software, such as erdas or envi.
But for some multiband tiff images, the image drawn on the screen is quite colorful. The shape and location of objects in the image is correct, but the color is distorted, and different from envi with the same input channel set and many possible input channel sets as well.
could anyone who is familar with gdal help me fix up this problem?
|
|
|
|
|
the best way i've found to diagnose TIFF issues is with TIFFDUMP (source comes with LibTiff, but you can probably find an EXE with Google). it will display all the tags in the TIFF.
so you can see what colorspace the TIFF uses, the order of bytes, samples per pixel, etc.. odds are that whatever TIFF reader you're using just isn't catching some tag combination. given the number of possible combinations, it's not uncommon for a TIFF reader to choke on some variants...
|
|
|
|
|
Hi all,
How to prevent same program can open twice in windows?I want limit my program can only 1 time in windows only. Can anyone suggest me a method to do it?
|
|
|
|
|
|
Thank you. This solve my problem
|
|
|
|
|
I've already written my code in C# and it works. But to integrate it into our product, I have to re-write it C++ 6.0. I'm very weak here and am lost. My problem is this: I start with a line extracted from a file. The string contains a variable number of individual commands consisting of one letter followed by a number. In C# my code is built like this:
private string[] LineSplitter(string LineIn){
if (LineIn == "")
return null;
string[] strOut = new string[0];
int i = 0;
string strChar;
do
{
...code to locate length of number following letter
} while ((isNumeric(strChar)) && (i + 1 < LineIn.Length));
strOut = (string[])ResizeArray(strOut, strOut.Length + 1);
strOut[strOut.Length - 1] = LineIn.Substring(0, i);
LineIn = LineIn.Substring(i);
} while (LineIn.Length > 0);
return strOut;
}
(And I'm sorry for putting C# in a C++ group, but I'm looking for the C++ equivalent)
Here are my questions...
1. How do I declare the function as string array?
2. How do I increment array elements until I'm done? Each line can have a variable number of elements.
3. How do I return the result.
Please be gentle. I'm struggling with C++ and this is my first post. I'm wrestling through the majority of everything else in this process, but this has my brain in a pickle.
|
|
|
|
|
Mark Randel wrote: 1. How do I declare the function as string array?
Not exactly an array but this is the C++ way -
std::vector<std::string>
Mark Randel wrote: How do I increment array elements until I'm done? Each line can have a variable number of elements.
while (LineIn.size() > 0)
Mark Randel wrote: How do I return the result.
std::vector<std::string> strOut;
.
.
.
return strOut;
modified on Wednesday, November 18, 2009 5:53 PM
|
|
|
|
|
Thanks a lot. The vector was the key to what I was looking for. I'm using CString , though. But it all works fine.
My question about adding to the array was concerning changing the size of the array. The vector makes that easy with the push_back command.
Also, returning the value from the function required that I make the type of the return as a vector:
std::vector<CString> CNCLine::LineSplitter(CString LineIn)
{
std::vector<CString> strOut;
... code
return strOut;
}
Works like clockwork. Thanks for the direction.
____________________________________________________
I'd rather have a frontal lobotomy than a bottle in front of me... Bill W
|
|
|
|
|
Interesting... the post erased the "<cstring>" command after the vector designation. Hope it doesn't with this text. Otherwise, I'm going to end up looking quite foolish.
____________________________________________________
I'd rather have a frontal lobotomy than a bottle in front of me... Bill W
|
|
|
|
|
That is because < and > are using by HTML for the tags.
Replace < with < and > with >
In fact you can simply click on the signs at the top of the editor to insert them.
|
|
|
|
|
Hi,
I have a simple application in MFC that creates files of (Name.ext) type. How can I make it launch the application by double clicking the file? Note, I can open the file from within the application?
|
|
|
|
|
If the file is an executable (like .EXE) you can use CreateProcess .
If the file is a document file (like .DOC) use ShellExecute with the "open" operation.
|
|
|
|
|
|
Thanks for the suggestion. I know how to open the app by double clicking, but what I am not sure how to do is how to handle double clicking a file created by the app. example:
my executable is "MyApp.exe", I use this to create files like "MyApp.dat". Where do I implement ShellExecute in the program to make "MyApp.dat" open up when double clicked?
Thanks
|
|
|
|
|
What is the format of your .dat file?
In which application do you intend to open it?
|
|
|
|
|
The App is a simple Dialog Application with an Edit Field that contains Text about the customer information. So, the data is simple CString Text. I would just like to have the file open when double clicking showing the customer Text as opposed to open the app and then point to the file.
Thanks
|
|
|
|
|
Maximilien has already answered that.
You have to associate .dat with your application.
|
|
|
|
|
I must be missing something, because I thought I had the association done. When I double click I get the App without the file info populated. But, I can look at my association code a bit more.
Thanks
|
|
|
|
|
Take a look at the documentation for CWinApp::EnableShellOpen() and CWinApp::RegisterShellFileTypes(BOOL bCompat) .
|
|
|
|
|
Did you use AppWizard to create the application? If so, it should have created a .reg file, and added a few lines (EnableShellOpen() and RegisterShellFileTypes() ) to the app's OnInitInstance() method to update the registry.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hi All,
I am using CAcroAXDocShim classes for AcroPDF.dll in my project.
My projects main dialog uses this control to display the PDF's.
From my Main dailog, if i use the scrollbar, the PDF control dosent refresh properly.
i.e brown stripes gets in middle all over the PDF.
I taught of posting a refresh message to the PDF Control, but CAcroAXDocShim class dosent have a refresh method.
Can any one give me some suggestions on how i can get out from this refresh issue.
Thanks,
Kasi
|
|
|
|
|
kasi14 wrote: From my Main dailog, if i use the scrollbar,
Is it the ActiveXControl's scroll bar? or the DialogBox has its own scroll bar?
-Suhredayan
|
|
|
|
|
Is there any way to determine plunging or removing of a removable storage like flash memories to the system in MFC?
Of course not by setting timer?
|
|
|
|
|
Windows will broadcast a message, see DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE,
so all it takes is catching these.
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|