|
toxcct wrote: you have bitmaps into a ini ?
off course the binary part...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
hoangtungoc wrote: how read from file *ini?
GetProfileString(...)[^] GetPrivateProfileString(...)[^]
hoangtungoc wrote: how load bitmap from file *.ini into button ?
Once you have the path from the ini file use LoadImage(...) to load the image file. Then to put it on a button look for documentation on CButton and examples for CButton. There are likely Articles here on Code Project that show how to put an image on a button.
|
|
|
|
|
I have found *.ini files that may be opened with notepad and they are readable, other not. I guess is due to Binary / Text flags by creating the file. But... some of that *.ini I have opened with Ultraedit, had no real sense. I mean, if you are saving a letter in binary you are having to have the ASCII number to represent the letter, aren't you? So, if in the *.ini are only squares, or symbols that don't appear correctly... It is because there is no "letters" just a relation of numbers that the programm understand because of the structure or place, but any (i.e) path to a file or something like that, isn't it?
Or am I misunderstanding something??
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek wrote: Or am I misunderstanding something??
Several things. You do not understand the term "binary" and the concept that data is "viewed", as in Ultraedit, which involves things like fonts etc. It is also possible that you do not understand the concept of storing data on disk and loading the data into memory.
This is interesting because I would suggest that, as a developer, ones work life would be significantly simplified if they clearly understand these issues. There are many others as well.
|
|
|
|
|
|
|
c:\Machine Controller - Source Code\Machine Controller.cpp(529): error C3363: 'int StartListening::initStartListening(void)' : cannot create a delegate handler for 'System::Threading::ThreadStart' from a non-member function or a member of an unmanaged class
Does anyone know how to resolve this error.Thanks
|
|
|
|
|
staticplus wrote: 'System::Threading::ThreadStart'
That appears to be .NET BCL classes and therefore you are in the wrong forum. Go to the C++/CLI forum for C++ .NET Managed development.
staticplus wrote: Does anyone know how to resolve this error.
Yes, you must use a managed delegate as the thread function for a managed thread.
|
|
|
|
|
This is my code snipped where i get this error:
if ((HWND)lParam == hwndStartListening) {
EnableWindow(hwndStartListening, false);
StartListening *a = new StartListening();
Thread *test = new Thread(new ThreadStart(a,StartListening::initStartListening));
test->Start();
//initStartListening();
break;
}
can you tell me how to create a managed delegate as the thread function for a managed thread for the code above. Thanks a lot
|
|
|
|
|
I am using CListBox(MFC Class) which have some strings added to it.I want
to display different string in different font.Is this possible?How this could be done?
regards,
priyank
|
|
|
|
|
If you need different strings within the same control to be shown using different drawing styles (or fonts), you will likely need to do an owner-drawn control.
I have an article that custom draws in a Combo-Box, and there are others around as well, like for drawing font names in their respective fonts. They will likely translate well for what you have to do.
Try searching on this site for "Owner draw", "Owner drawn", "owner-draw", etc. for more details. Stay away from "Custom Draw", because that generally only applies to the newer Win32 controls (i.e. CListCtrl but not CListBox ).
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Take a look in your documentation.
If CListBox::SetItemHeight (...) exists... is because it will most probably be possibl to change sizes and fonts.
Read about the LBS_OWNERDRAWVARIABLE style as well.
And if you want examples... take a look here[^]
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
How to generate checksum for a file?Sourcecode or algorithm will really help...
Thanks
|
|
|
|
|
|
Hello everyone,
I have noticed a lot of COM samples that the function AddRef and Release function of COM inteface is not synchronized to make it thread safe when dealing with adding/decreasing reference count.
Is it needed to synchronize AddRef and Release? Or the COM runtime underlying implementation handles thread safe issue by itself (i.e. transparent to upper layer COM server developer)
I am using Visual Studio 2005 to develop native (unmanaged C++) COM. No other framework is used (e.g. ATL).
thanks in advance,
George
|
|
|
|
|
George_George wrote: Or the COM runtime underlying implementation handles thread safe issue by itself (i.e. transparent to upper layer COM server developer)
No. There is no thread safety built into COM. That doesn't even make sense. There are Thread Models built into COM. Do some reading on COM and STA or Apartment Thread Model.
I also suggest reading Advanced Windows by Richter to gain a basic understanding of threading issues.
|
|
|
|
|
Thanks led mike,
You mean we need to add thread safe synchronization approach to AddRef and Release to make counter value thread safe manually?
regards,
George
|
|
|
|
|
George_George wrote: You mean we need to add thread safe synchronization approach to AddRef and Release to make counter value thread safe manually?
Well you can do it manualy or you can use a library like ATL to do it for you.
|
|
|
|
|
Thanks led mike,
Since I implement COM DLL server from scratch, I need to implement thread-safe synchronization approach manually to AddRef and Release. Thanks again.
regards,
George
|
|
|
|
|
George_George wrote: Since I implement COM DLL server from scratch, I need to implement thread-safe synchronization approach manually to AddRef and Release.
Yes, unless of course you are implementing an Apartment model then it doesn't matter since all of the interfaces will only be accessed from a single thread.
|
|
|
|
|
Intersted, what is Apartment model?
regards,
George
|
|
|
|
|
|
Thanks led!
Good article.
have a good weekend,
George
|
|
|
|
|
Hi,
I want to convert different character encodings like koi8-r to ASCII.
Where can I find information about them?
I can see there are many charsets - utf-8, windows-1251 etc.
|
|
|
|
|
Daniel Kanev wrote: I want to convert different character encodings like koi8-r to ASCII.
You can't convert kio8-r to ASCII. The former covers Cyrillic alphabet, and the later Latin (the English subset of Latin, really). What exactly do you want to do?
|
|
|
|