|
ns wrote:
How do I in code switch my defaultness to the 2nd button?
Ah, spoken like a true engineer. I'm extremely anal about spelling, grammar and general "correctness" of information displayed to the users of my apps, (as may come as no surprise to you).
GotoDlgCtrl (GetDlgItem (IDC_BUTTON_2);
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
In what function am I using your snippet? And if focus goes to button2, does that mean that "enter" clicks it? I cant try it out cause I dont see which function I am to use when the enter key is pressed in that particular textbox. Just give me some hints...I know yer a busy guy an ddo have some jailly..
|
|
|
|
|
Gosh darn it, it's easier than I thought! Ignore my earlier stupid, brain dead, coffee-deprived post. In your dialog's OnOK() handler, just do the right thing.
CMyDialog::OnOK()
{
CString strText;
m_myEditCtrl.GetWindowText (strText);
if (!strText.IsEmpty())
handlerForButton2();
else
CDialog::OnOK();
}
CMyDialog::handlerForButton2()
{
...
} /ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Many thanks......
the day winds down............. hour and half to go...........fridayyyyyyyyyyyyy. Going to hit the treadmill...walking is fun!
|
|
|
|
|
What an interesting difference - I just finished 6 months of 7x14 days and I'm going to spend my first free weekend working on a new hack (a freeware bug tracking system).
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
In an MDI CRichEditView derived app, when the user presses the tab key, I would like four spaces to be added rather than a tab. Any ways I can do this?
|
|
|
|
|
catch it in WM_KEYDOWN event handler?
when you found <tab> key was press. Then, do the things you want to your richeditview. Eg.
switch(wParam)<br />
{<br />
case VK_TAB : DoSomethingToYourricheditview(); break;
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi !
My question is about VC++ 6.0 evnironment.
I want to write an pure Assembler programs using ml.exe which I get through Service Pack 5 & Processor Pack.
------------------------------
Well I know how to create a console application(link options /SUBSYSTEM:CONSOLE and /ENTRY:mainCRTStartup is used), that requires MASM (ml.exe) to assemble SOME of its *asm files.
In this case I use custom build for these *asm files for example:
ml.exe -c -coff -Cx -Fo$(IntDir)\$(InputName).obj $(InputName).asm.
--------------------------------------
But I don't know how to create PROJECT which
consist of only assembler source files(/SUBSYSTEM:? /ENTRY:?).
May be using some Custom Wizard, but ... I don't know !
Is there anyone who can help me ?
Code Red
|
|
|
|
|
doesnt work like that... use other environment!
Don't try it, just do it!
|
|
|
|
|
How do you get the address of a method? I know how to declare a method pointer and use that, so I'm not totally lost.
But what I want to do is to cast the damn thing into a void pointer for later use in some ASM magic.
What I want to do is this:
void* ptr = (void*)&Class::Method but the compiler just won't let me cast it to a void*.
--
Stukas! Stukas im Visier!
|
|
|
|
|
|
I've tried that as well but to no avail.
--
Stukas! Stukas im Visier!
|
|
|
|
|
I just slipped on the keyboard and typed this: void* method = (void)Class::Method; . Notice the absent * in the cast operator? The compiler accepted it and left method uninitialized (0xcccccccc). Who smoked what, when and how in the Microsoft C++ compiler team?
--
Stukas! Stukas im Visier!
|
|
|
|
|
Jörgen Sigvardsson wrote:
Who smoked what, when and how in the Microsoft C++ compiler team?
ooo, that's sig material
That's really funny (in a sarcastic way) - assigning a void quantity to a void* is allowed. I guess the "anything can be implicitly converted to void* " rule really applies to anything, even nothing.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
CP SearchBar v2.0.2 released
|
|
|
|
|
I solved it.
void* ptr;
__asm push Class::Method
__asm pop ptr
I am evil. :cackle:
--
Stukas! Stukas im Visier!
|
|
|
|
|
Can you not simply use:
DWORD dwAddress = Class::Method;
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Nope. C++ is very picky about method pointer types it seems. Ordinary function pointers you can cast into float if you wish, but not method pointers.
It seems, __asm is the only way
--
Stukas! Stukas im Visier!
|
|
|
|
|
I have 2 arrays and I need to display data this way:
array1 array2
data1 data1
data2 data2
data3 data3
How do I dot this?
|
|
|
|
|
for (int x = 0; x < 2; x++)
cout << array1[x] << ' ' << array2[x] << endl;
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
IT depends - if you know they are the same length, and know what that length is, you can do this (using "cout" as an example, you can use print, or do it to a list box, or whatever.)
cout << "Array 1\t\tArray 2" << endl;
for(int i = 0; i < sizeOfArrays; i++)
{
cout << array1[i] << "\t\t" << array2[i] << endl;
}
Now, if your array sizes are different, it's tricker. You either need array classes (e.g., CArray or stl::vector), or variables specifying the size of each array, and then in the for loop, check to make sure you're not out of bounds, e.g. (assuming array1 and array2 are STL vectors):
cout << "Array 1\t\tArray 2" << endl;
int arraySize = array1.size();
if(array2.size() > arraySize)
arraySize = array2.size();
for(int i = 0; i < arraySize; i++)
{
if(i < array1.size())
cout << array1[i] << "\t\t";
else
cout << "(null)\t\t";
if(i < array2.size())
cout << array2[i] << endl;
else
cout << "(null)" << endl;
}
You can tweak the formatting as necessary.
If your nose runs and your feet smell, then you're built upside down.
|
|
|
|
|
The size of the array is the same, because I am using the parallel array.
|
|
|
|
|
Ugh, this smells like homework.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
OleLoadPicture() is currently refusing to load a JPEG file created in Adobe Photoshop 7.0, it returns E_FAIL. From looking at documents on the format of JPEG files I have determined that the signature is not standard but the file is a JPEG of some variety. The correct signature does exist about 300 bytes into the file and if I ignore everything before the signature the image will load but the rendered results are not correct. The image will load in both Paint and the Windows XP image viewer so I'm happy the image itself is ok.
Does anybody have any suggestions as to why OleLoadPicture() fails?
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
Hi guys
I'm trying to understand how it works serialization in Doc/View architecture
I have a view with some controls associated to booleans.
When I do a Open File I want to read the booleans from the file and then update the view.
I've tried to Serialize in Doc and then Update in OnUpdate in View but the controls are not refreshed. What is the correct order to do these things?
I'm doing something wrong?
Best Regards
Dr.Pi
|
|
|
|
|
Do you have something like:
class CMyDoc : public CDocument
{
public:
bool bValue1;
bool bValue2;
};
void CMyDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
ar << bValue1;
ar << bValue2;
}
else
{
ar >> bValue1;
ar >> bValue2;
}
}
void CMyView::OnUpdate( CView* pSender, LPARAM lHint, CObject* pHint )
{
CMyDoc *pDoc;
pDoc = GetDocument();
m_xbReady.SetCheck(true == pDoc->bValue1);
m_xbMixed.SetCheck(true == pDoc->bValue2);
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|