|
|
monsieur_jj wrote: Is it possible that http://www.codeproject.com/KB/web-security/Cryptography_MD5_TriDES.aspx?display=Print[^] may have a different output from a c++ version of the code?
any implementation of 3DES must give the same results as any other implementation, given the same inputs.
|
|
|
|
|
Hi,
I have one Edit box in dialog application(VC++ 6.0).Just i added spin control to the edit box, i have set the arnge for the spin control in the Init dialog function of my class. now am not able to see the value , when i use up/down in the spin control. it is updating in somewhere.
pls give any solution
Thanks in adavnce.
Thanks,
Balaji
|
|
|
|
|
See here.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Trz calling SetBuddy of the spin control specifying yout edit. Something like:
my_spin.SetBuddy(&my_edit);
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Hi ,
am not able to useSet Buddy MFC beacuse i have declared my edit box variable as double. if i pass the address of my edit box variable. it says cannot convert from double to CWnd*
thanks,
balaji
|
|
|
|
|
You have at least 3 possibilities:
1. as someone already mentioned, use the auto-buddy feature (set that to true in the dialog editor for your spin button and make sure the spin comes right after the edit in tab order)
2. specify a control variable too for your edit button (CEdit) and pass that to SetBuddy
3. use GetDlgItem() to get a pointer for your edit control and feed that to the SetBuddy call (presuming you already have a CSPinButtonCtrl type member assigned to your spin control.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
modified on Monday, December 8, 2008 5:37 AM
|
|
|
|
|
i have used GetDlgItem(ID name) and then what i have to pass in the SetBuddy function.
|
|
|
|
|
Sorry, i got mixed up there, i thought you had the double for your spin button, not your edit, i will edit my previous post and then check it again.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Ok No problem,
i have created control variable for spin control already.
m_voltspin.SetRange(0,50);
i have memeber variable for edit box in that i have declared as double.
i have set true in the spin control properties
(Auto Buddy), problem is am not able to see the values in the dit box when i press up / down the spin control, it is updating somewhre.
|
|
|
|
|
There's a spin button style called "Set buddy int" (UDS_SETBUDDYINT), make sure that is set for your spin button.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
|
do u have any idea
Actually i have Rich text contol present in my dialog. I will get messages from the board, when the messages exceeds the size of the window, scroll bar automatically comes because of i had set the scroll bar(Vertical scroll bar) property of Rich Text Control.
My question is, when message exceeds the window size, the scroll bar automatically goes up. i don want scroll bar to move up rather it should go down, then only i can able to see latest updates form the board at time itself.
Thanks in advance,
Thanks,
Balaji
|
|
|
|
|
Member 4651741 wrote: when i use up/down in the spin control. it is updating in somewhere.
Probably you have "Auto buddy" property set and your TAB order is not properly set.
As some one has already suggested you can set buddy window using SetBuddy member function of CSpinButtonCtrl class.
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
In the resource editor:
set the spin control's tab order immediately after the edit control
set the spin control's alignment property to Right (or Left)
check both the "Auto buddy" and "Set buddy integer" checkboxes
In the dialog's OnInitDialog() method, set the value via the edit control's SetWindowText() method.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi
I m working on Pocket PC application using C++ (Win 32). and i want to load multiple image on other single bitmap image (treated as a container of images) . and the new images are the child of the single bitmap image. and these images must be treated as a single bitmap image. i m trying to do this using offScreenBuffer , CreateCompatibleBitmap of Win 32 C++.
Please suggest how i do this.
Thanx
Mitesh
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
|
|
|
|
|
Well, i haven't written any progs for PocketPC but as far as i know this mainly works the same way as it does on the desktop platform, so what you should do is to create 2 memory DCs, select your target bitmap (the one you want to put the others on) in the first one and then the other bitmaps you want to put on the first one one by one into the second one and use BitBlt. So something like:
HDC TargetDC, SourceDC;
TargetDC = CreateCompatibleDC(NULL);
SourceDC = CreateCompatibleDC(NULL);
HBITMAP OriginalTargetBitmap = SelectObject(TargetDC, TargetBitmap);
...
HBITMAP OriginalSourceBitmap = SelectObject(SourceDC, CurrentSourceBitmap);
BitBlt(TargetDC, X, Y, CurrBmpWidth, CurrBmpHeight, SourceDC, 0, 0, SRCCOPY);
SelectObject(SourceDC, OriginalSourceBitmap);
...
SelectObject(TargetDC, OriginalTargetBitmap);
DeleteDC(SourceDC);
DeleteDC(TargetDC);
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Hi everybody,
I am trying to create dialogs in a loop.
I am having pointer to each dialog and resource id.
Problem is while creating an object of that dialog using new operator.
As new requires the typename which i am unable to provide in a loop.
Please refer the code below.
DlgA *pDlgA;
DlgB *pDlgB;
typedef struct tagDLG_INFO
{
CDialog *pDlg;
DWORD dwDlgID;
} DLG_INFO, *P_DLG_INFO;
DLG_INFO arrDlgInfo[2] =
{
{pDlgA, IDD_A},
{pDlgB, IDD_B}
};
for (DWORD dwLoopCount = 0; dwLoopCount < 2; ++dwLoopCount)
{
arrDlgInfo[dwLoopCount].pDlg = new XXX; //(How to provide typename in a loop).
arrDlgInfo[dwLoopCount].pDlg->Create(arrDlgInfo[dwLoopCount].dwDlgID, this);
}
I tried using macros, templates, RTTI, typeinfo,
but i did'nt find any proper solution.
Thanks in advance.
|
|
|
|
|
If not needed to create a modaless dialog then better to call DoMadal function of CDialog class to create Modal Dialog.
Sushrut
|
|
|
|
|
I am sorry that u didn't get the question.
what i want to do is similar to the following,
float *pf;
float *pf = new float; (This is the normal case where float is the typename passed to new operator).
(Now consider our problem)
int *pi;
char *pc;
If i have such many different types of pointers.
And i want to create memory to that respective pointer with it's respective type in loop.
So how am i able to provide typename to the new operator generically in a loop.
|
|
|
|
|
skmk1247 wrote: arrDlgInfo[dwLoopCount].pDlg = new XXX; //(How to provide typename in a loop).
Does this work for you?
arrDlgInfo[dwLoopCount].pDlg = IDD_A == arrDlgInfo[dwLoopCount].dwDlgID ? new pDlgA(this):new pDlgB(this);
Could also check for NULL
|
|
|
|
|
Your solution is good.
But i had given a sample of code.
What actually i want to do is to create around 20 dialogs of different types.
The resource i can have for this is the array of DLG_INFO.
For acheiving this we can extend or add more members to DLG_INFO.
Thanks.
|
|
|
|
|
|
Yes that is confusing but it is usable.
I'll give you the scenario,
I need to write options/settings module for a product.
The product is dialog based.
Now the options will be in a tree control on the left side.
When user clicks a particular option i need to display appropriate dialog.
There a 20 such options.
To hide or show the respective dialog first they need to be created.
The question i posted doesn't relate to number of dialogs to be created.
Instead, in a loop how can we provide the typename for new operator.
Just refer the root post.
Thanks.
|
|
|
|
|
Perhaps I fail to see what problem you are having. The solution I gave you will work for 2 dialogs or 20 dialogs if you modify it to a switch statement. In addition it should work for any CDialog derived class. What exactly is the problem you are having?
Here are some points:
1.) If your dialogs have a unique dialog resource ID associated with each CDialog derived class then you can easily identify which dialog belongs to which class.
2.) You can assign the CDialog pointer in your DLG_INFO structure to your derived class using the dynamic_cast operator[^] or the STATIC_DOWNCAST[^] macro.
3.) You can regain the type information by upcasting the CDialog pointer to access members.
Maybe I do not fully understand the problems you are having, if this is the case please clarify.
Best Wishes,
-David Delaune
|
|
|
|