|
Look at handling the WM_CHAR message.
"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
I am IT pro,next year.
If my PC not DOS & empty OS then
I can write edit pratition FAT32 program with fopen,fread ?
fopen can run not DOS,OS ?
how to: do this,code
can access HDD (read,write file) when emtpy OS
I will compile codes top with NASM in 7c00
I can all this
Please,good code I don't like book,guide
[vietnam 2009.CD]
thanks
|
|
|
|
|
tuan1111 wrote: fopen can run not DOS,OS ?
This makes no sense, I am afraid.
Your question is not easy to understand, but I gather you are having trouble reading and writing disk records from your program. However any simple explanation may not be an answer to your real question.
tuan1111 wrote: Please,good code I don't like book,guide
This will not help, you must learn and understand these functions, if you wish to gain knowledge of software. I would suggest buying a book in your own language that will guide you in how to use these functions.
|
|
|
|
|
Have a look at these articles [^], [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks in advance for your input.
I am trying to write a program that will handle DNA sequence, which is essentially text consisting of the letters A,T,C and G. The problems I am facing are:
1) The text needs to be displayed as double lines of text where A is above T, C is above G and so on, but text selection should act (wrap, etc) like it is seeing only the top row. Below shows a selected region (in bold) that wraps from one line to the next.
ATGTGTCGATCGATCGATCGATAGGATATATATTGAAG
TACACAGCTAGCATGCTAGCTATCCTATATATAACTTC
TGGAGCTAGCTAGGATCGAGTCATCGATCGACGGTACG
ACCTCGATCGATCCTAGCTCAGTAGCTACGTGCCATGC
2) I'd like to be able to place symbols in the spaces between line.
Any ideas on how to accomplish one or the other (or even both) would be greatly appreciated.
Thanks
Eric
|
|
|
|
|
What type of program do you have in mind?
Console or UI?
If UI, dialog based or SDI/MDI?
Here is one way I would do it.
Place on a dialog, 3 rich edit boxes one below the other with its border set to none and its background color the same as that of a dialog.
The first is for the first row.
The second is for the symbols.
The third is for the second row.
When a selection is made in the first edit box, an EN_SELCHANGE notification will be sent.
You can make the same selection in the third edit box using CRichEditCtrl::SetSel .
As for showing symbols in the second edit box, check the character value of the needed symbol using the charmap tool. Type charmap in the Run dialog box.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thank you for your insights. I was hoping to turn it (eventually) into an MDI, but it could also be an SDI with more than one view. I will have to give your interesting suggestions a try.
Cheers,
Eric
|
|
|
|
|
Hi,
I need to import methods of GUI MFC dll ( Frame + Views...).by a client application (ie. console application).I tried do do the classic importation with __declspec(dllexport) but i have some problems with InitInstance() method and others.
So can you help me? and if there is some source codes it can be more helpful.
Thanks
|
|
|
|
|
The functions in the MFC dll are all designed to work within the MFC framework.
You can't import selected functions and expect them to work out of context.
Try recreating your project as an MFC console application.
|
|
|
|
|
but what i want is to create a dll which has a Frame, a View and a Document (GUI) and use it by an other application !!!
|
|
|
|
|
Then you should look up creating an MFC dll.
There is a lot of documentation on that in MSDN.
|
|
|
|
|
Hello
I am working on an Up-Down spin control which is used to update values in
a text control.
The range of values are from 20 to -20.
What i have seen is, if i click the UP or DOWN arrow and keep it
pressed, then somehow after counting 15 it will stop decrementing or inceremting.
i.e., if the current value is 20 and now am clicking the DOWN button and keep
it pressed, the text control value will decrement upto 5, and then will stop there.
Now i have to release the mouse button and then again click the DOWN arrow to further decrement.
Now again after 15 decrements it will stop decrementing and i have to release the
mouse and click again.
Any idea why this happening?
|
|
|
|
|
dipuks wrote: I am working on an Up-Down spin control which is used to update values in
a text control.
Are you referring to an msctls_updown32 control? If you are using MFC, do you have a CSpinButtonCtrl object associated with it?
dipuks wrote: The range of values are from 20 to -20.
How did you set this range?
I just tried this and it works fine for me.
"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
|
|
|
|
|
Are you referring to an msctls_updown32 control?
YES
If you are using MFC, do you have a CSpinButtonCtrl object associated with it?
I am not using MFC, am working using Win32 API's
|
|
|
|
|
dipuks wrote: I am not using MFC, am working using Win32 API's
So then are you sending the control a UDM_SETRANGE message?
"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
|
|
|
|
|
Yes UDM_SETRANGE32
Am using all 32 bit messages,
UDM_SETPOS32, UDM_GETPOS32,...
in UDM_DELTAPOS i try to update the value in text control
|
|
|
|
|
dipuks wrote: UDM_SETPOS32, UDM_GETPOS32,...
in UDM_DELTAPOS i try to update the value in text control
By default, these are not necessary. Assuming the up/down control comes right after the edit control in the Z-order, do you have the UDS_AUTOBUDDY and UDS_SETBUDDYINT styles set?
"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 have a MDI document which has to load an ascii file into a collection class on File-Open, preferably before serialization of the classes that I load using the standard CArchive serialization since those elements are dependent on the collection class. In other words my code looks like this -
void CMyDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{.....
else {
CFile ChartFile;
if (!ChartFile.Open(m_DataPathName, CFile::modeRead)){
return FALSE;
}
CArchive archive(&ChartFile, CArchive::load);
while (archive.ReadString(FileData) != NULL){
m_MyCArray.Add();
ar >> MyVar1
>> MyVar2
>> ....
}
It's all working now but the code to read the ascii file originally read some variables from the DOC class and also wrote some to the DOC class. Here is what happened before I removed that code -
1. I would get random exceptions on accesses to the variables in the doc class (sometimes they would happen, sometimes not) when exercising the File-Open menu.
2. Any Doc class variable that was set from inside this routine would be garbage after it completed.
The odd thing about this is that the container class m_MyCArray is valid after exiting this routine. Perhaps it's because m_MyCArray is instantiated (indirectly) in the Doc class while I accessed the other Doc variables with a pointer to the doc class (because the ascii file read routine is actually a seperate module instantiated in the doc class - to complex to show above).
I got this idea from an example in Jeff Prosise's book so presumably it's valid but I think there were some timing issues with my code. Perhaps the new doc class is still being initialized or is initialized after the completion of serialization. Mike Blaszczak's book has some info on how a new doc comes to life but he does not say anything about serialization in this regard.
As I said, after removing all pointer based accesses to the doc class everything seems to work fine but it would be nice to understand what state the doc class is in at the time of serialiazation or what happens afterward.
Thanks
|
|
|
|
|
I don't actually trust the serialisation of MFC all that much - it looks fine for trivial things, but it doesn't take a lot before it fails, or is not flexible enough.
I have a few questions...
You say about doc variables being valid in another routine, but that's hidden with a comment - we can't help you a lot there.
Do you make sure you clear all your doc variables in the constructor so they're valid but... boring... ?
Where does the file name m_DataPathName come from? It's not from the opening process? But as the Serialize function is called during CDocuments auto loading process, which include constructing the CDocument, ehen do you set it?
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi Guys,
I am pretty new to C++. And would require your help.
I am trying to get surname into a string using getline(cin,surName) and then passing it to a function to convert the string to upper case. Please note that I know there are functions available to do the conversion but I am trying to learn passing / returning "string" from a function.
Thanks in Advance
Tomic
char* conv_str_to_upper (char* str_io)
{
int stringlength = strlen(str_io);
for (int i=0; i
|
|
|
|
|
A C++ string isn't a char* . You can't apply old C char* based methods to handling C++ string s.
|
|
|
|
|
Tomicmanka wrote: for (int i=0; i str_io[i] = std::toupper(str_io[i]);
Did you bother to preview this before posting?
Tomicmanka wrote: conv_str_to_upper (surName);
Is conv_str_to_upper() going to know what to do with a string object?
Tomicmanka wrote: free (pstrText);
What are you freeing?
Go back and edit your post so that it is: 1) syntactically correct, and 2) easier to read.
"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
|
|
|
|
|
Sorry mate, The text "free (pstrText);" was part of a larger program.
As I said I am very new (I have benn working on C++ for the last one week) so just bear with me.
I just want to know how to write a c++ function that accepts a string as parameter and return a string back to the main() function.
At this moment in time I want to convert a lowercase Surname to uppercase using a C++ function.
char* conv_str_to_upper (char* str_io)
{
int stringlength = strlen(str_io);
for (int i=0; i
str_io[i] = std::toupper(str_io[i]);
}
return (str_io);
}
The code above may be wrong, I just want to know how it can be done.
Thanks
|
|
|
|