|
No. As I already stated, I'm looking to create the dialog for my 'About Box' using MFC. I would imagine that, given the code to create a dialog for my 'About Box' using MFC, I would then be able to integrate the code into the cpp file that creates my plugin.
|
|
|
|
|
Did you try using the resource Editor?
There you can design the dialog and add a class to that dialog template and load the dialog when you need it.
-Prakash
|
|
|
|
|
I will check it out but I was actually hoping to find a simple coded dialog to integrate into my plugin file to see if this will work to begin with.
|
|
|
|
|
building a simple dialog using the resource builder will take about 3 min. you cant get faster than that
-Prakash
|
|
|
|
|
Hi,
I have an array of values that is unsorted, having values like 12, 18, 15, 25, 22, 27, 21, 30, 19, 2
I want to rank them acording to the follwing rule , Lets they are 10 values in total
Greater value has the number 10, values less then this will have number 9 , so on , and the least value will have number 1.
How can I do it
thanks
Regards.
|
|
|
|
|
Why can't you just sort the array. The values will be ranked to your given criteria:
rank = "array index of value" + 1.
|
|
|
|
|
zahid_ash wrote: I have an array of values that is unsorted, having values like 12, 18, 15, 25, 22, 27, 21, 30, 19, 2
Apply reverse Bubble Sort and check the Element at the Index!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote: zahid_ash wrote:
> I have an array of values that is unsorted, having values like 12, 18, 15, 25, 22, 27, 21, 30, 19, 2
Apply reverse Bubble Sort and check the Element at the Index!
Attention!
This only works if no values appear twice in the vector!
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
jhwurmbach wrote: This only works if no values appear twice in the vector!
Thanks for correcting me.. But it seems there is no vector here.. the person seems using old C based array and if you see I especially Quoted his number before giving the answer!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote: But it seems there is no vector here
But it really should
And its just a matter of:
std::vector<int> vec( &array[0], sizeof(array)/sizeof(array[0]));
to copy array into the STL-vector vec .
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
jhwurmbach wrote: But it really should
Yeah you are right
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
What windows message is created when a SD card is inserted or removed from a USB SD Card reader?
I tried creating a CDialog app and using Spy++ to track it, but you must need to register for it because nothing came to the CDialog window.
And since Windows will offer you services when you insert a card, such as opening explorer to the card... it must be there.
I tried using Spy++ on the explorer window for the SD card reader... but it was a mess of information.
OS is XP or 2000
C++ only please, as i am sure .Net has a pretty answer
thanks
|
|
|
|
|
|
If using MFC, u will get notification OnDeviceChange()
|
|
|
|
|
anilFirst wrote: OnDeviceChange()
Sorry to Point you Sir, OnDeviceChange() is mapped function of WM_DEVICECHANGE only!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Tried the following... It catches the CD door as a reply said it would... no dice on the SD card reader.... Somebody alse asked the question today in a different thread. Another, less obvious course of action was given.
I will repost if that works
LRESULT CTestSdcardDlg::WindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)//HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
int i = 5;
i++;
switch (uMsg)
{
case WM_DEVICECHANGE:
// Initialize the window.
AfxMessageBox(_T("Test catch"));
break;
default:
break;
}
return CDialog::WindowProc(uMsg, wParam, lParam);
}
|
|
|
|
|
This is an update.... using a different poster's thread answer....
I can now get the insertion and removal of the SD card reader.... I still cannot get the card insertion/removal.
Since its frustrating when people do not post full code examples when they are looking help, i will offer this for code for those of you that solely need to detect a USB device insertion/removal, even though it does not do what i need .......
static /*const*/ GUID GUID_DEVINTERFACE_USB_DEVICE =
{ 0xA5DCBF10L, 0x6530, 0x11D2, { 0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED } };
bool CTestSdcardDlg::DoRegNote()
{
DEV_BROADCAST_DEVICEINTERFACE devInter;
ZeroMemory(&devInter, sizeof(devInter));
devInter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
devInter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
devInter.dbcc_classguid = GUID_DEVINTERFACE_USB_DEVICE;
if(RegisterDeviceNotification(g_hWnd, &devInter, DEVICE_NOTIFY_WINDOW_HANDLE) == NULL)
{
int i = GetLastError();
int j = 5;
}
return true;
}
LRESULT CTestSdcardDlg::WindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)//HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
switch (uMsg)
{
case WM_DEVICECHANGE:
// Initialize the window.
AfxMessageBox(_T("Test catch"));
break;
default:
break;
}
return CDialog::WindowProc(uMsg, wParam, lParam);
}
|
|
|
|
|
Hi,
I can not have a focus on my button without having a message box on my frame.
Ex: when i have a message or pop-up on my code, i can have a focus on my dynamic button. Otherwise, i can not.
Can you help me!
Thank you.
|
|
|
|
|
Can you use SetFocus() to set focus to the button?
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
|
have you made the control of the button. If yes get the window* for that CWnd and use SetFocus()
Wishes.
Anshuman Dandekar
Dare to Dream,
Care to Achieve.............
|
|
|
|
|
For some reason one malloc works but every other time it fails. Is there something in .NET or a setting that I have to change? This is weird, 'head' allocates and I assign to it but 'myList' never gets memory allocated to it. Any ideas? I'm trying to work with C more that's why I'm using malloc.
paul
<br />
<br />
struct myNode<br />
{<br />
int number;<br />
myNode* link;<br />
};<br />
<br />
int main ()<br />
{<br />
myNode* myList = NULL; <br />
myNode* head = NULL;<br />
<br />
myList = (myNode*)malloc(sizeof(struct myNode));<br />
head = (myNode*)malloc(sizeof(struct myNode));<br />
<br />
myList->number = 4;<br />
myList->link = NULL;<br />
<br />
head->number = 1;<br />
head->link = NULL;<br />
<br />
return 0;<br />
}<br />
|
|
|
|
|
hi,
could you please tell how you're verifying your assertions ?
did you debug or use any if (myList != NULL) ?
i cannot see what's wrong in your code. all seem to be correctly done...
one thing anyway : did you check the remaining memory on your computer ??
(even if i doubt it could be that...)
ps: if you're going to cose with C, declare your struct variables like this :
struct myNode* myList = NULL;
struct myNode* head = NULL;
ps2: when you use dynamically allocated variables like this, don't use them directly as you do here, because there always is the risk that the variable is not allocated, and so, the call to -> operator will fail... (which seeems to be exactly the case here) ; round your code with check tests as presented previously...
ps3: don't forget to free the memory you malloc ated...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
-- modified at 13:40 Wednesday 8th February, 2006
|
|
|
|
|
You brought up some good points, thanks for the feedback. I didn't have any if statements to test but when it crashed I used a quickwatch on some of the variables. It would create head* but no myList*, I have no idea why. The code is identical for both of them. Maybe I should try GCC just so I can compare the results.
paully
|
|
|
|
|
paully wrote: ...but when it crashed...
Where?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|