|
So no help here? If not I will post it over there.
I'm sure it's not a big thing, can nobody help me?
|
|
|
|
|
tdlrali wrote: I'm sure it's not a big thing, can nobody help me?
Its not big thing for Managed C++ Programmmer.. But about normal VC++ programmer... its like asking a Database person problem of JAVA!..
Thats why I given you link of Managed C++ forum!.. hope now you understand why you not getting answer there
"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
|
|
|
|
|
|
toxcct wrote: CLedButton[^]
Hai Tox,
Its seems he has problem related to Managed C++ and he willing to make its own control, I hope you are comfortable enough in Managed ... to solve his problem.
"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: I hope you are comfortable enough in Managed ... to solve his problem.
nop not at all
ThatsAlok wrote: Its seems he has problem related to Managed C++
yeah, i saw this, but it seemed that the guy didn't know where to look... actually, it is not the right answer, but he's now aware that CP is the best place for search a search...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
I am new to the forum, so please bear with me. I have since created an Acrobat plugin using Visual C++ 6 along with the Acrobat SDK 6. While the Acrobat API provides a means to create and add an 'About' dialog box, for reasons too numerous to list, I would rather use MFC to create a simple 'About' dialog box for my plugin. As of this time, I already have code inside my plugin initialization cpp file that creates my 'About' menu item for an 'About' box. There is also an area for inserting code that creates the 'About' box that gets called from the 'About' menu item. The'About' box I'm looking to create would contain the usual title in the title bar along with 3-4 short lines of static text inside the dialog box, and two buttons namely, an 'Ok' button to close the dialog, and another button with my web site URL. As I already have the MFC installed on my system, rather than reinvent the wheel, I'm looking for a code snippet to accomplish this task and the easiest way to integrate the code to create my 'About' dialog box. I would also like to know if the code using MFC to create a dialog box can be added to the initialization cpp file that creates the plugin or if I need to create a separate cpp file to accomplish this task? While I'm a relative newcomer to using C++ and have been able to learn enough to create a plugin, I do have to admit that I'm far from being an expert C++ programmer. Needless to say, any and all feedback anyone can provide to help me accomplish this particular task is very much appreciated. ;)
|
|
|
|
|
have you already created the dialog? and
is that if you try to launch the dialog the dialog would not open?
-Prakash
|
|
|
|
|
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.
|
|
|
|
|