 |

|
I need to develop a tool which peroform all operation on USB drive attached on other computer.
Application needs to perform all operation which can be perform by local compter.
Please guide me how to start and wnat things I need to lookinto?
|
|
|
|

|
Hi
I am getting the following compiler error in that the compiler can't find filea.cpp
I am using visual studio 2010 professional
The file appear in my project -> source files
When I right click in each of the .cpp source files and compile them Separately they each compile
cleanly including filea.cpp
Is there anyway to tell where this compiler error is coming from
Thanks
|
|
|
|

|
Hi,
I am using DirectShow to Play / Pause / Stop and Capture Video files. But Capturing and playing of video files is simple. I want to Implement HD Video recording in my project.
Anybody have any idea of how to Implement HD Video Capturing using DirectShow.?
Or Apart from DirectShow, is there any other method to Implement HD Video recording in MFC.
Regards,
Mbatra
|
|
|
|

|
Hi,I need to open a httpfile by Proxy Server,but the UserName and Password I set always fail,I don't know why,I tried many times,I don't know how to do,Can you have any ideas.
Here is My code:
CString strURL = _T("http://www.kkkk.com/");
CInternetSession Session(_T("Get Xml"));
CHttpFile *lpFile = NULL;
try
{
//set proxy info
char sProxyList[MAX_PATH], sProxyName[64],sProxyPassw[64];
strcpy(sProxyName,"mmm");
strcpy(sProxyPassw,"mmm");
INTERNET_PROXY_INFO proxyinfo;
proxyinfo.dwAccessType = INTERNET_OPEN_TYPE_PROXY;
proxyinfo.lpszProxy =_T("192.168.0.1:8080");
proxyinfo.lpszProxyBypass = NULL;
Session.SetOption(INTERNET_OPTION_PROXY,(LPVOID)&proxyinfo,sizeof(INTERNET_PROXY_INFO));//Success
if (! Session.SetOption(INTERNET_OPTION_PROXY_USERNAME, sProxyName, strlen(sProxyName)+1))
{
DWORD ret = GetLastError();//Always return 12018.Why?
}
if (! Session.SetOption(INTERNET_OPTION_PROXY_PASSWORD, sProxyPassw, strlen(sProxyPassw)+1))
{
DWORD ret = GetLastError(); //Always return 12018.Why?
}
}
lpFile = (CHttpFile*)Session.OpenURL(strURL,1,INTERNET_FLAG_TRANSFER_ASCII|INTERNET_FLAG_RELOAD|INTERNET_FLAG_DONT_CACHE);
if (lpFile != NULL)
{
while(TRUE)
{
char szBuff[1024] = {0};
if ( lpFile->Read(szBuff, 1024) <= 0)
{
break;
}
strContent += szBuff;
}
}
}catch(CInternetException* pEx)
{
TCHAR pszError[64];
pEx->GetErrorMessage(pszError, 64);
strErrorMsg = pszError;
pEx->Delete();
}
delete lpFile;
lpFile = NULL;
Session.Close();
|
|
|
|

|
Hello, i have a question about the MSXML library. I fail to find how exactly they read the XML Document when its already loaded into memory. If i look for XML nodes do they read the whole document from top to bottom until find it or its something with hash tables.
My problem is that i have to remove some elements for existent XML document and add it in another. I was wondering which is better(according to speed) to keep the XML Nodes in std::vectors and remove the needed items and put them in the new XML Document and this only with 2 read/write operations on the XML Document or i should get the first part of the items do whatever i have to do with them and then take the next part and so on. This will cause for at least 8 times reading the existent XML Document and getting XML NodeLists out of it. The problem here is that the first XML Document can be really big.
I think its better to read the information only once and do what i have to do with it and then write it in the new XML Document. At least i think its gonna be faster but i am not sure exactly how MSXML does the operations on the XML Document.
Thank you for your help.
|
|
|
|

|
I want to make an Active X ctrl that communicates with a device and then sends data to main program. I want to know that Does activex work as seperate process. Does main program waits on ActiveX ctrl or I can do sperate processing simultaneously in my main program.
Thanks in advance.
|
|
|
|

|
I am using vc++ 6.0. I Have made an unlicensed activex ctrl application from app wizard (MFC activeX ctrl wizard for generating random drawing). When I am testing this Activex by ActiveX control test container, all functions are working fine, but when I am testing it with dialog application, On calling any method of ActiveX it is giving error debug assertion failed. Program ......
File: winocc.cpp; line: 345
I am making an object of this ActiveX ctrl wrapper class in my testing dialog application and then calling method defined in this ActiveX ctrl.
My code:
CNewSquiggleAcX m_ClNewSquigg;
CFileDialog m_ldFile(TRUE);
// Show the File open dialog and capture the result
if(m_ldFile.DoModal()== IDOK)
{
CString m_sResults;
m_sResults = m_ldFile.GetFileName();
//m_ClNewSquigg.GetSquiggleLength();
m_ClNewSquigg.LoadDrawing(m_sResults); // Error comes in this line calling any activex function
}
Calling any method of this self created unlicensed ActiveX ctrl is giving error.
Please help.
|
|
|
|

|
I need to achieve a functionality but do not know how to start please guide:
Functionality:
USB Data Card (like internet data card) is attached with system A, system A is recognising device as USB device but I need to use that card using system B which is having all drivers of data card.
How to achieve it?
|
|
|
|

|
Hello Everyone,
I need a function to implement zero copy approach.Can anyone provide me some examples or suggestions about this?
|
|
|
|

|
When I try to compile a piece of code using the Intel Compiler, I get this error:
error: declaration may not appear after executable statement in block
I know I shall have all the declaration at the beginning of my code, but I'm eager to know why this should raise an error. GCC and the VS Compiler didn't give any errors.
Thanks in advance.
modified 2 days ago.
|
|
|
|

|
No debuggers, well, none here anyway, and none as good as I have used on Windows, so it is printk() debugging. A 20 minute full build needed to get any new code in and then it takes 10 minutes to reflash the OS image on the device.
Never have I been forced to work so slowly.
Windows? Different matter. Windbg, live embedded debugger, automatically sucks the newly built module off the host when the target boots, public symbols, full stack and disaasembly on a crash,
I am going to have to put something together for linux/ARM like Windbg....
==============================
Nothing to say.
|
|
|
|

|
Now, I have a VC++ project which will occupy 1.5 G memory(the peak value), and then it will give back memory in 5 minutes. But, I want to optimize the memory usage, because 1.5 G is too huge. Besides, I'm rather sure there are no memory leaks in my codes, I have tested my codes with 3 tools(PurifyPlus, Debug Diagnostic and CMemoryState function).
Anybody can help me? Or are there some tools to help me to do that?
Again, I must emphasize 'there are no memory leaks in my codes, I'm rather sure'. So, don't mention 'memory leaks' in the comments.
PS: I'm using Visual C++ 2010. And my project is made up of about 1400k lines of code.
modified 2 days ago.
|
|
|
|

|
I am trying to enumerate processes and WriteProcessMemory. I get the following errors on compilation in Visual C++. I just don't do anything related to TOKEN and all. How to solve the error ?
error C2061: syntax error : identifier 'TOKEN_INFORMATION_CLASS'
error C2061: syntax error : identifier 'PTOKEN_PRIVILEGES'
error C2061: syntax error : identifier 'PTOKEN_GROUPS'
error C2061: syntax error : identifier 'TOKEN_TYPE'
in file c:\program files\microsoft sdks\windows\v6.0a\include\winbase.h
|
|
|
|

|
***** What I want is I should get exact no of entries and filenames as the no of files copied..***** When I copy files in the monitored directory through 4 cmd's all with copy command copying files from windows, system32, c:\, d:\ directory at a time.. this function ReadDirectoryChangesW() does not give correct output. It misses many files entries and also shows repetitive filename as file added and then modified. It is all because till the system writes the file completely, it continuously keeps giving the notification too. so we have multiple entries for same file. ***** What I want is I should get exact no of entries and filenames as the no of files copied.. So I think if I hook CopyFile/CreateFile(A/W) API, then I can trace all the files created/copied in c:\temp (putting c:\temp as the filter).. Please help.. Thanks in advance..
|
|
|
|

|
I am getting the following error
error RC2135: file not found: STRINGTABLE
error RC2135: file not found: 0xF000
1>
error RC2135: file not found: 0xF001
1>
None of the items pointed to by the resource compiler are files
I am at a loss
MSDN states for this error The file specified in the Resource Compiler command line was not found
I did a build from Visual Studio Professional 10.0
I don't know what is on the resource compiler command line
|
|
|
|

|
Hi, I am using ATL::CAxWindow for hosting some Activex control in my mfc mdi application. How do I use the scrollbars of an atl::CAxWindow ? The code I used to create ATL CAxWindow. CAxWindow m_AxWnd; CMDIChildWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, pContext); AtlAxWinInit(); RECT altRect; GetClientRect(&altRect); m_AxWnd.Create(m_hWnd, altRect, NULL, WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL); m_AxWnd.CreateControl(L"Some ActiveX control"); Thanks,
|
|
|
|

|
My legacy app. uses this message handler to do button enabling / disabling. However it gets called very frequently (eg on mouse move).
is there any way of filtering / controlling the messages that cause this function to get called? I can't see why I'd want to do anything with my toolbars & icons in response to UI messages anyway.
Thanks
|
|
|
|

|
Hello there
I am working on a C++ MFC app that has a user login option and the software will store upto
15 passwords used by a user.
Now i want to store each password used by a user in a string array and make sure that the user
doesn't use an old password when updating the password.
i.e., password once used cannot be re-used and an existing password will expire after a set number of days.
The question is what kind of collection class i need to use for efficient management of old passwords?
CArray?CList? CString array?
Any sample code will help.
Thanks in advance.
|
|
|
|

|
Hi, I have written a code in C++ which works on the "POINT" user defined type i.e. POINT = (x,y).
I am giving input in int form, it is converting it into point might be using "template". I am retrieving these point from another function which is a header file of mine.
Now the problem is, I am calling this function in NS-3 software/program, I am unable to convert this point form into integer.
* Can i return more than one value from a function, because point has two values i.e. X and Y.
Please help me out.
|
|
|
|

|
I am trying to create a dialog MFC application that reads the cursor position anywhere on the screen, finds the colour of the pixel at that location and reports the information back to the dialog application.
I have tried SetCapture and I must be doing something wrong because the cursor location stops reporting as soon as the cursor leaves the client area of the dialog. I have also looked at the "Screen Color Picker" by Florin Vasilescu. That uses an OnTimer function that allows me to read the screen location, but does not report mouse actions (LBUTTONDOWN) so that I can read the pixel at the cursor location.
I have also tried using SetWindowsHookEx and defining the MouseProc (as described by Vesi in the CodeGuru article "Modal dialog and outside mouse control". That wasn't successful. If I use the WH_JOURNALRECORD hook ID as described there appears to be an indeterminate delay between any mouse (or keyboard) action and interaction with screen objects. If I use the WH_MOUSE no mouse actions are detected.
Could someone help me with how to either properly set SetCapture() or point me to where I might discover how to read mouse actions outside the dialog box? I'm happy to supply code, but at this point it's a bit of a mess since I've been trying everything.
Thanks for any help you may be able to provide. Much appreciated.
|
|
|
|

|
I found if set TTF_TRACK flag to CTooltipCtrl, SetDelayTime doesn't work anymore, so the tooltip won't disappear automatically. I want to show the tooltip just below specified control, and expect it to disappear after a few seconds(the time can set with SetDelayTime). Anybody can help me?
Here is my steps to construct tool tip:1. Add member variable
CToolTipCtrl m_tooltip;
2. override PreTranslateMessage
BOOL CPF_GetSetNameDlg::PreTranslateMessage( MSG* pMsg )
{
switch (pMsg->message)
{
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
case WM_LBUTTONDOWN:
case WM_RBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_LBUTTONUP:
case WM_RBUTTONUP:
case WM_MBUTTONUP:
case WM_MOUSEMOVE:
m_tooltip.RelayEvent(pMsg);
break;
}
return CDialog::PreTranslateMessage(pMsg);
}
3. OnInitialDialog
BOOL CPF_GetSetNameDlg::OnInitDialog()
{
CDialog::OnInitDialog();
//tooltip
EnableToolTips();
m_tooltip.Create(this , WS_POPUP | TTS_NOPREFIX | TTS_BALLOON);
m_tooltip.SetDelayTime(TTDT_INITIAL, 0);
m_tooltip.SetDelayTime(TTDT_AUTOPOP, 30000);
m_tooltip.SetDelayTime(TTDT_RESHOW, 30000);
m_tooltip.AddTool(GetDlgItem(IDC_SETNAME), _T(""));
m_tooltip.SetMaxTipWidth(600);
}
4. Control to show tool tip
if(bShow)
{
m_tooltip.UpdateTipText(_T("Hello, money!"), pWnd);
CToolInfo sTinfo;
m_tooltip.GetToolInfo(sTinfo, pWnd);
sTinfo.uFlags = TTF_TRACK;
m_tooltip.SetToolInfo(&sTinfo);
CRect rect;
pWnd->GetWindowRect(rect);
m_tooltip.SendMessage(TTM_TRACKPOSITION, 0, (LPARAM)MAKELONG(rect.left, rect.bottom));
m_tooltip.SendMessage(TTM_TRACKACTIVATE, TRUE, (LPARAM)&sTinfo );
}
|
|
|
|

|
I have this code:
if(m_Bitmap.GetSafeHandle())
m_Bitmap.DeleteObject();
HBITMAP hBitmap = (HBITMAP)::LoadImage(NULL, lpszPathName, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
if(NULL == hBitmap)
{
CString sMessage;
const DWORD dwError = ::GetLastError();
sMessage.Format(_T("Failed to load '%s' file. Reason: %s\n"), lpszPathName, GetErrorString(dwError));
AfxMessageBox(sMessage, NULL, MB_ICONERROR);
return FALSE;
}
m_Bitmap.Attach(hBitmap);
and work ok, but on the big bitmaps, I get:
Not enough server storage is available to process this command
ok, I read this one[^], and I modified the "IRPStackSize" value to 0x19 (25 decimal), not working ... hoe can I get rid of this error ?
modified 12-Jun-13 4:37am.
|
|
|
|

|
Hello Friends
I am using SetupDigetRegistryProperty to access USB Devices.
So,regarding that I was trying to access Property SPDRP_LEGACYBUSTYPE which is described like this
Quote: SPDRP_LEGACYBUSTYPE
The function retrieves the device's legacy bus type as an INTERFACE_TYPE value (defined in Wdm.h and Ntddk.h).
I tried to get this value in char ,it returns some special character. I tried to catch in DWORD,it returns some number.
DWORD DataT;
LPTSTR buffer = NULL;
DWORD buffersize = 0;
SetupDiGetDeviceRegistryProperty(
hDevInfoSet,
&DeviceInfoData,
SPDRP_LEGACYBUSTYPE,
&DataT,
(PBYTE)buffer,
buffersize,
&buffersize)
Any Ideas?
Regards
Y
|
|
|
|

|
Hi,
I working on a plugin system for a MFC C++ application. So I started with a small plugin DLL with a simple function creating an object of a class with virtual functions and returning that object to the caller. The object is created on the heap and actually a pointer to the object is returned.
In the main application a function loads the plugin (LoadLibrary), searches the exported function (GetProcAddress) and executes the function. As result the created object is available, as expected. So far so good.
Btw: the class is already declared in a different DLL linked by both the main application and the plugin DLL.
Next I want to unload the plugin with FreeLibrary.
That leads to the problem of a corrupt vftable of the created object. I found out, that the __vfptr is in the memory of the plugin DLL and so unloading the DLL destroys that memory and the __vfptr is not usable anymore.
Is there any way to change that behaviour?
with kind regards,
Joerg
|
|
|
|

|
Creating webbrowser as below
hret=CoCreateInstance(clsid,NULL,CLSCTX_ALL,IID_IUnknown
,reinterpret_cast<void**>(&m_pUnknown));
hret=m_pUnknown->QueryInterface(IID_IWebBrowser2,(PVOID *)&m_pBrowser);
ASSERT(SUCCEEDED(hret));
but when i say
HRESULT hret = m_pBrowser->Navigate2(varURL,&noArg,&noArg,&noArg,&noArg);
its opening new IE window on WIn7. But in Xp sys its not happening like that. I dont want to open new IE window
Any one has any idea why it is opening on new IE window on Win7
|
|
|
|

|
Hi,
I am working on a project in which I use DirectShow to Play / Pause / Stop the video. I am using progress bar which increments along with the video. Now I want to use Slider bar instead of the progress bar which should increment along with the video. Also user should be able to control the video using slider (move forward / backward). I had used timers in which I am incrementing the progress bar.
How to use Sliders so that while video is playing, slider should increment along with the video showing the progress of the video.
Anybody have any idea or any sample code for the same.?
Regards,
Mbatra
|
|
|
|
 |
|