Is there any safe way to PostMessage() string data between processes. WM_COPYDATA cannot be used since it should not be posted.
Thanks, Renjith V R
Is there any safe way to PostMessage() string data between processes. WM_COPYDATA cannot be used since it should not be posted.
Thanks, Renjith V R
Here i saw a code for c# and i convert it to vc++.But i tried it many way.i didn't get errors in this code.
but output is not get
private: System::Void toolStripButton1_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e)which dataformats is used for button here........................................................
I've created dozens of C++ COM Add-Ins using Visual Studio 2010. However, 2013 will not let me get passed the following step. When I right click in the Class View and select "Implement Interface ..." the
following occurs:
1. First the Wizard shows up. I select "Microsoft Add-In Designer<1.0>"
2. After selecting _IDTExtensibility2 interface I select Finish and get the following error
"An error occurred while setting the error info."
After doing CreatePolygonRgn and SelectClipRgn, I draw a vector long enough to cover the polygon area --- pDC->MoveTo(p1) & LineTo(p2).
The p1 & p2 are adjusted each time based on the current zoom factor of the screen. As I zoom in using the mouse wheel, at some point, a piece of the line is broken and displaced on a wrong spot... That is, I see two lines. This happens at some high zoom factor, and if I zoom out again, my line is OK with the proper clipping based on my polygon.
This only happens on lines close to vertical (but not exactly 90 degrees), and only on some high zoom-in situation. As I pan the picture, the broken line lengths change.
I am re-drawing the line every time I zoom or pan, executing the same piece of code that sets the clip rgn, draw, and disable the clip by pDC->SelectClipRgn().
Is this a graphic card issue? This problem does not happen in PC SAFE MODE run...
Thank you
Makoto
This is an image of broken lines:
http://screencast.com/t/47mPbq3u0
I have a Word Add-in written in C++/ATL and want to access the COM interface of another add-in written in C#. The developer of the C# add-in has provided code that would do the job in C#, but I'm having trouble translating that to C++.
Here is the example provided (some variable names changed):
I believe that the C++ version sould include something like the following:
IDispatch *bApp = NULL;
_AtlModule.m_pGIT->GetInterfaceFromGlobal( dwCookie, L"FOO.BAR.POC.Listener", (PVOID*)&bApp );
But this produces an error:
Error2error C2664: 'IGlobalInterfaceTable::GetInterfaceFromGlobal' : cannot convert parameter 2 from 'const wchar_t [24]' to 'const IID
I tried replacing parameter 2 with the GUID of the add-in, but that produced essentially the same error.
Any suggestions would be welcome.
I'm seeing an unknown error (80004005) in my application when I use this function to display property pages in Windows 8.1 or 10.
This worked in Windows 7 and XP.
My component(s) that contain the property page(s) are not normally registered with "regsvr32" as I create object instances directly (using custom factory code) but if I do register the .dll(s) I've developed it works as expected. Problem
is, I don't want to release projects where .dll(s) are registered. That's why I wrote my own factory code.
Is there any workaround other than to register .dll(s)?
(Note: I've tested registering and unregistering the .dll(s) while the app is running, once it's registered it works and shows the pages even once unregistered, until the app is restarted, where it consistently fails again under the new OS's.)
When debugging, I receive...
Debug Assertion Failed|
Program ...
File: f:\dd\vctools\crt_bld\self_x86\crt\src\output.c
Line: 2293
Expression: ((state == ST_NORMAL) || (state == ST_TYPE))
Here is the code.
// Code2A.h
#include <afxwin.h>
#include <math.h>
#define m 20
#define LinkRange 200
class CCode2A : public CFrameWnd
{
private:
typedef struct
{
int Wt,sd;
int via[10];
}LINK;
LINK e[m+1][m+1];
CRect rec[m+1];
CPoint home,end;
int sou,des;
int i,j,k,lFlag;
double alpha[m+1][m+1][m+1],x[m+1],y[m+1];
public:
CCode2A();
~CCode2A();
afx_msg void OnPaint();
afx_msg void OnLButtonDown(UINT,CPoint);
void compute();
void computepath();
void drawpath();
DECLARE_MESSAGE_MAP()
};
class CMyWinApp:public CWinApp
{
public:
virtual BOOL InitInstance();
};
CMyWinApp MyApplication;
BOOL CMyWinApp::InitInstance(void)
{
m_pMainWnd = new CCode2A;
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}
how to solve it???
Hello everyone!
I am developing a software that pinpoints problems in WLAN connectivity using the Native WiFi API. I am trying to simulate scenarios for my code to identify problems using WLAN Reason Codes (https://msdn.microsoft.com/en-us/library/windows/desktop/ms707394%28v=vs.85%29.aspx).
I can connect to a WPA2-PSK network and I am using the Notification Callback to get the WLAN Reason Codes. I deliberately changed my network security key to find out if the notification callback can see that the reason for not being able to connect is a PSK mismatch. However, the reason that was identified is that the "Dynamic Key Exchange did not succeed within the configured time." This reason and the PSK mismatch are related, but I want to see that the Notification Callback actually identifies the PSK mismatch (WLAN_REASON_CODE_MSMSEC_PSK_MISMATCH_SUSPECTED).
Is this possible using the Native WiFi API? If yes, how can I do it?
Thank you!!!
Hi, i am trying to achieve that my Listcontrol will display tooltip for every cell. But i need it to be displayed
a little bit right to cursor. But it won't work, When i'am using TTF_TRACK tip doesnt even show up. I've tried
many variations with sendmessage and other but it still won't work. How can i resolve that?
void CListCtrl_OwnToolTipCtrl::OnMouseMove(UINT nFlags, CPoint point) { //SendMessage(hTool, TTM_ADDTOOL, 0, (LPARAM)&toolInfo); //MessageBox(text,NULL,MB_OK); CPoint pt(GetMessagePos()); ScreenToClient(&pt); // Find the subitem LVHITTESTINFO hitinfo = {0}; hitinfo.flags = nFlags; hitinfo.pt = pt; SubItemHitTest(&hitinfo); if (m_LastToolTipCol!=hitinfo.iSubItem || m_LastToolTipRow!=hitinfo.iItem) { // Mouse moved over a new cell m_LastToolTipCol = hitinfo.iSubItem; m_LastToolTipRow = hitinfo.iItem; // Remove the old tooltip (if available) if (m_OwnToolTipCtrl.GetToolCount()>0) { m_OwnToolTipCtrl.DelTool(this); m_OwnToolTipCtrl.Activate(FALSE); } // Add the new tooltip (if available) if (m_LastToolTipRow!=-1 && m_LastToolTipRow!=-1) { // Not using CToolTipCtrl::AddTool() because it redirects the messages to CListCtrl parent TOOLINFO ti = {0}; ti.cbSize = sizeof(TOOLINFO); //ti.uFlags = TTF_IDISHWND | TTF_TRANSPARENT | TTF_ABSOLUTE | TTF_TRACK; // Indicate that uId is handle to a control ti.uFlags = TTF_IDISHWND | TTF_TRANSPARENT; ti.uId = (UINT)m_hWnd; // Handle to the control ti.hwnd = m_hWnd; // Handle to window to receive the tooltip-messages //ti.rect = rcClient; ti.hinst = AfxGetInstanceHandle(); ti.lpszText = LPSTR_TEXTCALLBACK; m_OwnToolTipCtrl.SetToolInfo(&ti); m_OwnToolTipCtrl.AddTool(GetDlgItem(IDC_LIST1),LPSTR_TEXTCALLBACK); m_OwnToolTipCtrl.SendMessage(TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti); //m_OwnToolTipCtrl.SendMessage(TTM_TRACKACTIVATE, true, (LPARAM)&ti); m_OwnToolTipCtrl.SendMessage(TTM_SETDELAYTIME, TTDT_INITIAL, 500); m_OwnToolTipCtrl.SendMessage(TTM_SETDELAYTIME, TTDT_AUTOPOP, 5000); //m_OwnToolTipCtrl.SetToolRect(m_hWnd, ) //CPoint vt(GetMessagePos()); //m_OwnToolTipCtrl.SendMessage(TTM_TRACKPOSITION, 0, (LPARAM)MAKELPARAM(pt.x, pt.y+10 )); //m_OwnToolTipCtrl.SendMessage(TTM_TRACKACTIVATE, true, (LPARAM)&ti); m_OwnToolTipCtrl.Activate(TRUE); //Multiline m_OwnToolTipCtrl.SetMaxTipWidth(256); //m_OwnToolTipCtrl.SetMaxTipWidth(SHRT_MAX); } } CListCtrl::OnMouseMove(nFlags, point); }
I want to develop the program that make a PC communicate with another PC or AVR via Bluetooth.
Most examples I found in MS and several web are Win32 console program and suggest how to make socket just like
Socket = socket(AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM);
But I'm more familiar to dialog-based programming using MFC.
Is it possible to use CSocket or CAsyncSocket class for the bluetooth communication?
I am doing a program in C++ in Visual Studio 2013 IDE. The program uses Qt5 and openGL in Qt5.
Everything works when I am building and starting program in IDE (both Debug and Release modes).
But when I am trying to run the program by double clicking the generated .exe file, the following error occurs:
Cannot find the entry point for the procedure __cxa_throw_bad_array_new_length in library libstdc++-6.dll
Do you have any clues what I may doing wrong?
Thanks for any comments,
Adam
I have an application that can become full screen (through a DXGI swap chain). I handle the WM_KEYDOWN event to watch for Escape key presses to exit full screen. That works ok. But when I press ALT+TAB while in full screen, I get some visual artifacts and the application seems to get into a limbo state where it isn't really full screen anymore but not windowed either.
How can I handle ATL+TAB while in full screen to properly exit full screen?
I am basically a VB6 Programmer also using Access. I found running in the background the following
NAME SIZE (MB) VERSION
Microsoft Visual C++ 2005 Redistributable 300.00 | 8.0.61001 | ||||
Microsoft Visual C++ 2005 Redistributable (x64) 620.00 | 8.0.59192 | ||||
Microsoft Visual C++ 2005 Redistributable (x64) 572.00 | 8.0.56100 | ||||
Microsoft Visual C++ 2005 Redistributable (x64) - KB2467175 580.00 | 8.0.51011 | ||||
Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.17 755.00 | 9.0.30729 | ||||
Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.6161 700.00 | 9.0.30729.6161 | ||||
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.17 596.00 | 9.0.30729 | ||||
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.6161 600.00 | 9.0.30729.6161 | ||||
Microsoft Visual C++ 2010 x64 Redistributable - 10.0.40219 13.80 10.0.40219 | |||||
Microsoft Visual C++ 2010 x86 Redistributable - 10.0.40219 11.10 10.0.40219 I also have loaded
which I believe I need for my VB6. |
Do I need these? Can I delete these.
Thanks
When debugging, I receive...
Debug Assertion Failed|
Program ...
File: f:\dd\vctools\crt_bld\self_x86\crt\src\output.c
Line: 2293
Expression: ((state == ST_NORMAL) || (state == ST_TYPE))
Here is the code.
// Code2A.h
#include <afxwin.h>
#include <math.h>
#define m 20
#define LinkRange 200
class CCode2A : public CFrameWnd
{
private:
typedef struct
{
int Wt,sd;
int via[10];
}LINK;
LINK e[m+1][m+1];
CRect rec[m+1];
CPoint home,end;
int sou,des;
int i,j,k,lFlag;
double alpha[m+1][m+1][m+1],x[m+1],y[m+1];
public:
CCode2A();
~CCode2A();
afx_msg void OnPaint();
afx_msg void OnLButtonDown(UINT,CPoint);
void compute();
void computepath();
void drawpath();
DECLARE_MESSAGE_MAP()
};
class CMyWinApp:public CWinApp
{
public:
virtual BOOL InitInstance();
};
CMyWinApp MyApplication;
BOOL CMyWinApp::InitInstance(void)
{
m_pMainWnd = new CCode2A;
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}
how to solve it???
Hello everyone, so my code is pretty straight forward i push a button and it runs backgroundworker. The code inside backgroundworker has a while loop that will run until it is broken. After i break it it just stay "there" does not do go to backgroundworker completed. This is the code: (i found the code inside backgroundworker from another site, sorry cant remember) So yeah after i press enter it breaks the while loop but like i said it never goes to backgroundworker completed, what do i have to do to tell the application that it has finished?
//===================================================== private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { backgroundWorker1->RunWorkerAsync(1); } //===================================================== private: System::Void backgroundWorker1_DoWork(System::Object^ sender, System::ComponentModel::DoWorkEventArgs^ e) { double startTime = GetTickCount(); int i = 0; while (true) { double currentTime = GetTickCount() - startTime; if (currentTime >= 3000) //3 seconds. { std::cout << i << ":) "; updateThingsHere(); i = i + 1; //Reset the timer. startTime = GetTickCount(); } //Run other code here while not updating. char key = ' '; if (_kbhit()) key = _getch(); if (key == 13) break; //Quit the while loop else if (key != ' ') { key = ' '; } } } //========================================================= private: System::Void backgroundWorker1_RunWorkerCompleted(System::Object^ sender, System::ComponentModel::RunWorkerCompletedEventArgs^ e) { MessageBox::Show("Work completed!!"); std::cout << "DONE/FINISHED" << std::endl; } //========================================================= void updateThingsHere(){ std::cout << "DOING THINGS" << std::endl; }
I'm having a bit of trouble with the macro's $(VCInstallDir) and $(WindowsSdkDir).
I can hack the .props file in %AppData%\Local\Microsoft\MSBuild\v4.0 and get the compiler to work for both 32 bit and 64 bit by putting the fully qualified paths in but seem to have trouble getting the above macro's to work in all scenarios.
Is there a reference somewhere how these macro's obtain their values or does anyone have pointers on changing the value the environment uses?
Also a related question, I notice the 64 bit executable directory is listed as $(WindowsSdkDir)\bin\x64 but when I use the fully qualified path in Visual Studio I get an error that it can't run rc.exe. Changing the path to the equivalent of $(WindowsSdkDir)\bin seems to work. Should I be using the x64 directory and if so, how do I get the programs to actually run? I've been able to create make files for both x64 and x86 that use the bin\x64 and bin directories just fine.
Larry Charlton
Hello,
As we work to migrate our code to build with Visual Studio 2015, we are stuck with a linking error - LNK2019 unresolved symbol.
The page - https://msdn.microsoft.com/en-us/library/bb531344(v=vs.140).aspx mentions about Template resolution. It mentions about invalid template instantiations, that with VS 2015, that, SFINAE requires the compiler to instantiate the specialization of a class template.
With the example provided in the same section, I did see the mentioned compiler error, which is as per expectation. However, to fix the compiler error, it asks to move the definitions of structures B and D to the beginning of the code. Unfortunately, I am still not able to build the code snippet, as I get a linking error -
error LNK2019: unresolved external symbol "public: __thiscall S<struct D>::S<struct D>(struct S<struct D> const &)" (??0?$S@UD@@@@QAE@ABU0@@Z) referenced in function "void __cdecl f1(void)" (?f1@@YAXXZ) 1>c:\users\rupsharma\documents\visual studio 2015\Projects\ConsoleApplication1\Debug\ConsoleApplication1.exe : fatal error LNK1120: 1 unresolved externals
Here is how my cpp file looks like after the fix:
// ConsoleApplication1.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <type_traits> struct B { }; struct D : public B { }; template<typename T> struct S { S() = default; S(const S&); S(S&&); template<typename U, typename = typename std::enable_if<std::is_base_of<T, U>::value>::type> S(S<U>&&); }; struct D; void f1() { S<D> s1; S<D> s2(s1); } void f2() { S<D> s1; S<D> s2(s1); } int _tmain(int argc, _TCHAR* argv[]) { f2(); return 0; }
It seems to be a bug to me, which has been troubling us, while trying to migrate our project to VS 2015 RC. It would be great if you can check on this.
Thanks,
Rupali