|
even though i change it, its not working..
|
|
|
|
|
The for() loops are wrong.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
maibam debina wrote: //covariance1 is the input matrix But you've not shown how it's defined. If you have something like:
float covariance1[5][8];
And you are trying to access it in determinant() like:
for (int p = 1; p <= 5; p++)
covariance1[p][q]...
You can expect an access violation.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I cant get u properly can u please ellaborate...
|
|
|
|
|
Hello everyone!
I need an important information that how much samples VC++ can plot in real-time. I am taking 500 samples per second . Is it possible to plot these samples real time in our VC++ GUI ?
If yes what is the configuration of system that it could support?
If anyone can help me I am really helpful to them.
Thanks in advance.
|
|
|
|
|
If you need fast plotting, you're more than likely going to have to get very familiar with the Windows GDI[^]. The toolset is very basic but very fast, works great for high-speed plots.
|
|
|
|
|
We would call this a system modal situation, but there is a twist - I have no source code for the application in question (so, no ::SetWindowPos).
The big picture - my application is running, and it's full screen. Think of a kiosk like application... no window manager, no task bar, no keyboard. Should the user choose to, they can invoke a calibration utility for the touchscreen. When calibration is complete, the utility helpfully posts an AfxMessageBox("Calibration complete"). Here's where my woe begins...
If the user is careful, they can press the acknowledge box and the utility terminates. Choose poorly, and the application pops up over the dialog, effectively causing a blocking window inversion.
I think I can work around this by not blocking with the CreateProcess call, but I haven't tried it yet. So, any other ideas? I'm going to write the oem for a variation on the utility, but I don't have much hope there.
thanks
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
You can still use SetWindowPos .
You just need to get the handle to the message box.
FindWindow will get you this handle.
The best way would be to install a shell hook using SetWindowsHookEx which will then give you a notification when the message box pops up and also its handle.
You could then use SetWindowPos on the handle to make it top most.
It is for you to decide if it is worth installing the shell hook because it will effect the entire system.
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
Ah, I understand now. Thanks.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
You could do your own calibration or have vendor remove dialog box. Failing that, when the calibration utility is started, you could have a thread monitor windows ans when that window pops up, either force it to the foreground or just close it yourself.
Where it gets tricky is that only the current active, foreground application can make another application the foreground and despite appearances, who is this application isn't always straightforward. To get around this for one project, I ended up writing the following (The W is the prefix for my personal, but in-the-public-domain, library:
bool WSetAppToForeground(LPCWSTR pWindowName)
{
HWND hWnd = FindWindow(NULL, pWindowName);
if (!hWnd)
return false;
WSetAppToForeground(hWnd);
return true;
}
void WSetAppToForeground(HWND hWnd, bool showMax, bool setFocus)
{
#ifndef _WIN32_WCE
DWORD foregroundProcessId = GetWindowThreadProcessId(::GetForegroundWindow(), NULL);
DWORD curThreadId = GetCurrentThreadId();
AttachThreadInput(foregroundProcessId, curThreadId, TRUE);
#endif
ShowWindow(hWnd, showMax ? SW_SHOWMAXIMIZED : SW_SHOW);
BringWindowToTop(hWnd);
SetActiveWindow(hWnd);
SetForegroundWindow(hWnd);
if (setFocus)
SetFocus(hWnd);
#ifndef _WIN32_WCE
AttachThreadInput(foregroundProcessId, curThreadId, FALSE);
#endif
}
|
|
|
|
|
Hi i am searching many information about this, but i only find complex code. I simply need a context menu with icons. Now i post my code can you help me to complete?
CMenu Menu;
Menu.CreatePopupMenu();
Menu.AppendMenuW(MF_STRING,ID_POPUP_1,(LPCTSTR)_T("Item 1"));
Menu.AppendMenuW(MF_STRING,ID_POPUP_2,(LPCTSTR)_T("Item 2"));
Menu.AppendMenuW(MF_STRING,ID_POPUP_3,(LPCTSTR)_T("Item 3"));
theApp.GetContextMenuManager()->ShowPopupMenu(Menu, point.x, point.y, this, TRUE);
I have seen on MSDN i have to use this:
ASSERT(m_CheckBitmap.LoadBitmap(IDB_CHECKBITMAP));
ASSERT(m_UnCheckBitmap.LoadBitmap(IDB_UNCHECKBITMAP));
CMenu* mmenu = GetMenu();
CMenu* submenu = mmenu->GetSubMenu(4);
ASSERT(submenu->SetMenuItemBitmaps(ID_MENU_BITMAP, MF_BYCOMMAND,
&m_CheckBitmap, &m_UnCheckBitmap));
But i think my situation is more easy than example, but maybe i have problems to merge the two code parts,
please can you help me i don't think take you more time.
Thanks very much.
|
|
|
|
|
According to the documentation[^], the bitmaps are just used to indicate the item is selected or not. The MSDN sample shows you how to add the two bitmaps to your menu items. When you say you just want icons, do you mean without any text? If so you need to look at http://msdn.microsoft.com/en-us/library/kb145b0a.aspx[^], for the options to set up individual menu items.
|
|
|
|
|
I need a popup menu with an icon 16x16 on the left and the text on the right, for every menu item.
|
|
|
|
|
I gave you the link to the documentation, you just need to follow the instructions.
|
|
|
|
|
|
(disclaimer, I've not tried it on a popup menu; only regular menu).
The simplest way is to use CMFCToolBar::AddToolBarForImageCollection.
You create a dummy toolbar with all the images you want to use and call the above static method and the images will automagically be added to the menus.
I'd rather be phishing!
|
|
|
|
|
Can you show me in code if is possible?
|
|
|
|
|
It is quite simple, just create a new toolbar with the images you need (with the same ID as your menu ID).
and call
CMFCToolBar::AddToolBarForImageCollection(IDR_MENU_IMAGES);
at the end of the "OnCreate" of the mainframe (in case of a MFC document).
Have a look at the C++/MFC samples available on MSDN.
http://www.microsoft.com/en-us/download/details.aspx?id=5718[^]
There are examples of that in the: "VisualStudioDemo", "NewControls" samples. (among others).
I'd rather be phishing!
|
|
|
|
|
I done it!!!!
I did so:
1) OnCreate i put this as you told me:
CMFCToolBar::AddToolBarForImageCollection(IDR_MAINFRAME_256);
2) in Contextmenu i add these lines:
CMFCPopupMenu* PopupMenuFolders = new CMFCPopupMenu();
CheckWhatCanIDo(ExtractFullTreePath(htSelectedTreeItem),MainComputerinfo.szSid,m_bUserAuthorizations);
PopupMenuFolders->InsertItem(CMFCToolBarMenuButton(ID_POPUP_FOLDERS_TREE_1, NULL, 0, _T("Item 1")));
PopupMenuFolders->InsertItem(CMFCToolBarMenuButton(ID_POPUP_FOLDERS_TREE_2, NULL, 1, _T("Item 2")));
PopupMenuFolders->InsertItem(CMFCToolBarMenuButton(ID_POPUP_FOLDERS_TREE_3, NULL, 2, _T("Item 3")));
PopupMenuFolders->Create(this, point.x, point.y, NULL);
So you use directly the Toolbar Images.
Thanks all
Giovanni
|
|
|
|
|
Hello
I'm trying to open the COM Port on a Windows CE Device in C++ but without any success
I'm sure that the port exist and available becaus I can use it from cSharp
To do it with C++ I'm trying to use the CreateFile method
The first issue was that CreateFile needs a LPCWSTR
And as it is a long time that I did'nt work with C++ in Windows I had to find ho to assign a LPCWSTR Pointer
So here is my attempt
But it give an Error 2 during execution
NB : I've also tryed different declaration of the Com port but with the same bad result
wchar_t tt[]=L"COM5";
wchar_t tt[]=L"COM5\0";
wchar_t tt[]=L"COM5:";
wchar_t tt[]=L"COM5:\0";}
I can't believe that there is no way to open the Com port on Win CE in cSharp
Thanks for any help
wchar_t tt[]=L"COM5";
int len=0;
int result=0;
char *buffer;
DWORD dw;
hComm = CreateFile( tt,
GENERIC_READ | GENERIC_WRITE,
0,
0,
OPEN_EXISTING,
NULL,
NULL);
if (hComm == INVALID_HANDLE_VALUE)
{
dw=GetLastError();
}
|
|
|
|
|
As far as I know, CreateFile 's first argument must be a LPCTSTR .
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
Great !
You help me a lot
1- It is LPCTSTR indeed
2- The column is required
This is working
LPCTSTR portname = L"COM5:";
int len=0;
int result=0;
char *buffer;
DWORD dw;
hComm = CreateFile( portname,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
NULL,
NULL);
if (hComm == INVALID_HANDLE_VALUE)
{
dw=GetLastError();
int uu=5;
}
|
|
|
|
|
The correct way to set the LPCTSTR is:
LPCTSRT portname = _T("COM5:");
As far as I know, the column is NOT required.
By the way, you are welcome.
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
Hi,
CPallini wrote: As far as I know, the column is NOT required.
It is required. Alternatively the full device namespace path can be used: "\\\\.\\COM1"
Best Wishes,
-David Delaune
|
|
|
|
|
Randor wrote: It is required
Is it a CE thing or this very MSDN example[^] is wrong?
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|