|
vvlnkishore wrote: i am trying to embed mspaint into an mfc application
-> Interesting... how you done it ?
vvlnkishore wrote: with a mouse i want to read the position coordinates. is it possible ?
Sure!
Trap,
CWnd::OnMouseMove, OnLButtonDown, OnLButtonUp
Also,
CRect::PtInRect[^] (Determines whether the specified point lies within CRect.)
modified on Thursday, May 7, 2009 10:07 AM
|
|
|
|
|
thank you madhu. but how can i assign the coordinates to fX & fY. i am new to this programming. actually an MFC is developed using mediaplayer control. in that we are displaying the input image. in that image we are giving region of interest coordinates manually. but our people wanted it to be done just by mouse click using mspaint control. can you help me in this.
|
|
|
|
|
Is there any way to find which all .lib, .dll etc files are included in a exe ?
or
Is there any way to find which all .lib, .dll etc files are included in a .lib ?
I used dumpbin.exe but its not verbose.
RKP
|
|
|
|
|
Visual Studio has a dependency viewer (depends.exe).
Not too verbose but it will show you the static dependencies in a UI.
You can then do profiling to get all other DLLs that are loaded dynamically.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
i think depends.exe will help you.
depends.exe comes along with microsoft visual studio.
|
|
|
|
|
Thanks Superman and ChandraShekharanp for the reply.
There is one problem in using Depends.exe.
In the project I have an exe which inturn is made up of a number or custom projects dll, .lib etc. In depends.exe only the standard dlls of c:\windows\system32\ etc are displayed. None of the projects dll, lib files are displayed. I configured the module search order, but in vain.
Is there any way to display the projects dll, lib files along with the functions included in those dll ?
RKP
|
|
|
|
|
RKP728 wrote: In the project I have an exe which inturn is made up of a number or custom projects dll, .lib etc. In depends.exe only the standard dlls of c:\windows\system32\ etc are displayed. None of the projects dll, lib files are displayed
depends does display all statically linked DLLs when you use it to open an exe. I know - I've used and relied on it - it works. So, that maybe means that your exe isn't statically linked to your project's DLLs. Try running your exe with depends' 'Profile->Start Profiling' menu command.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Hi,I want to read/write Files(ex:music files) meta data in my program.
I know how to use functions like
int _wstat64(const wchar_t *path,struct __stat64 *buffer); But it didn't provide information which I want like "Artist,Album,Year and..." which known as file details in windows.
Any idea how to reach these fields for R/W?
|
|
|
|
|
I believe this article[^] may be relevant.
It's not as easy as just calling wstat or any other C run-time library function - the information's buried a bit deeper than that...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks The article was totally nice and the answer
|
|
|
|
|
Hi All,
I was trying to delete some specified files.
and was able to delete the files using absolute path.
But when i gave relative path, the thing is not working.
Plz help.
|
|
|
|
|
Its probably because the relative path given is incorrect.
Make sure the relative path is correct by maybe opening the file using CreateFile .
It could also be that the current working directory is different from the location of the EXE.
You can use SetCurrentDirectory to set the current working directory.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
In some part i am creating the files giving relative path,
and same paths are being used while deleting also..
But not working, i will give that snippet
CString FilePath= _T("..\\..\\Dev\\Devices\\MCAL_Template_Make\\*.mak");
SHFILEOPSTRUCT sfo;
ZeroMemory(&sfo,sizeof(sfo));
sfo.wFunc = FO_DELETE;
sfo.pFrom = FilePath;
sfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI ;
SHFileOperation(&sfo);
|
|
|
|
|
Padmanabha_M wrote: But not working, i will give that snippet
Code snippet or not, relative paths are just just...relative. You must first ensure (hint: don't assume) that the current working directory is such that "..\\..\\Dev\\Devices\\MCAL_Template_Make" is a valid folder.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
I'm using the Ultimate Toolbox Library, and working with the SkinsDemo example of the library distributed packages. It's just great, but i have two questions:
1- The original example using TabAllDockedControlBars() to group FoldersBar and the PropertiesBar on a Tabbed bar at the right of the main window. But at the initialization, the Tabbed bar was minimized to the right border, and nothing shown. If I remove the TabAllDockedControlBars(), three bars are shown, but not tabbed. So why? and how to init it at a specific size ?
2- Now I have 3 FolderBar(s), and want to arrange them in one colunm, three row at the right of the main window. And three bars must be calculated automatically to have the same size (or heigh). So what I have to do?
Please help!
Thanks and Regards!
|
|
|
|
|
As we all know,we use microsoft web control to link some web site.add the control to my application.My fragment code is:
//in mydlg.h file
CExplorer1 m_web;
// on some functions in mydlg.cpp file
VARIANT vTarget;
vTarget.vt = VT_BYREF|VT_I1;
vTarget.pcVal = ("_SELF");
m_web.Navigate("http://mysite/login.jsp?logname=mylogname&password=mypassword",NULL,NULL,NULL,NULL); (1)
m_web.Navigate("http://mysite/query.jsp",NULL,NULL,NULL,NULL); (2)
//the above code (1) is no problem,but, if i want to link a query page (2) after (1) ,is refused.
please, how to solve the problem if i want to link a page after link the verification or login page such as "http://mysite/login.jsp"?
thanks advanced very much!
|
|
|
|
|
Not very good in Web programming, there may be alternatives. But how about redirecting from login.asp ? Also, why not waiting to complete the first navigate. There are events from web browser control to check the status of navigation.Please check the design.
|
|
|
|
|
cwj_ wrote: //the above code (1) is no problem,but, if i want to link a query page (2) after (1) ,is refused.
Ummm - I note you don't check any error return values - it might help if you did and told us what they were - that could point to the reason your code isn't working as you hope...
Also - the class 'CExplorer1' - that's not one built into MFC (or any other class library I know of) - what, pray tell, might it be?
Finally - your problem is likely to be because you haven't waited for the web control to actually finish loading the first web page before navigating to the second one - the web control's Navigate method is not synchronous - it returns pretty much immediately, not after hte web page has completely loaded. You need to handle the web control's NavigateComplete[^] event to detect when the first web page has been completely loaded.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
use this,have a try
CString url;
GetDlgItemTextW(ULREDIT,url);
VARIANT var;
var.vt = VT_BSTR;
var.bstrVal = L"_self";
this->m_browser.Navigate(url,NULL,&var,NULL,NULL);
|
|
|
|
|
the article is, the programming window ... make the matrix of the matrix A
This is the code which i did but algorithm fails...
can you help me decode...thanks!
#define IDC_MYBUTTON 100 // Идентификатор кнопки
#define IDC_MYEDIT1 102 // Идентификатор поля редактирования 1
#define IDC_MYEDIT2 104 // Идентификатор поля редактирования 2
#include "afxwin.h"
#include <iostream>
using namespace std;
class CMyButton: public CButton
{
public:
afx_msg void OnLButtonDown(UINT, CPoint);
private:
DECLARE_MESSAGE_MAP();
};
void CMyButton::OnLButtonDown(UINT, CPoint)
{
AfxMessageBox("...");
}
BEGIN_MESSAGE_MAP(CMyButton, CButton)
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
class CMainWnd : public CFrameWnd
{
public:
CMainWnd();
afx_msg void OnLButtonDown(UINT, CPoint);
afx_msg void OnRButtonDblClk(UINT, CPoint);
afx_msg void OnKeyDown(UINT, UINT, UINT);
~CMainWnd();
CStatic* MyStatic;
CMyButton* MyButton;
CEdit* MyEdit1, * MyEdit2;
DECLARE_MESSAGE_MAP();
};
BEGIN_MESSAGE_MAP(CMainWnd, CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_RBUTTONDBLCLK()
ON_WM_KEYDOWN()
END_MESSAGE_MAP()
void CMainWnd::OnKeyDown(UINT, UINT, UINT)
{
AfxMessageBox(" Key Button Down ");
}
void CMainWnd::OnRButtonDblClk(UINT, CPoint)
{
AfxMessageBox(" Rigth Button Click ");
}
void CMainWnd::OnLButtonDown(UINT, CPoint)
{
char buff[255];
int count=0;
MyEdit1->GetLine(0,buff);
AfxMessageBox(buff);
}
CMainWnd::CMainWnd()
{
Create(NULL,"Лабораторная работа № 10",WS_OVERLAPPEDWINDOW,CRect(500,250,800,450),
NULL,NULL);
MyStatic = new CStatic();
if (MyStatic!=NULL) MyStatic->Create("matrix",WS_CHILD|WS_VISIBLE|SS_CENTER,
CRect(100,10,140,50),this);
MyButton = new CMyButton();
MyEdit1 = new CEdit();
if (MyEdit1!=NULL) MyEdit1->Create(WS_CHILD|WS_VISIBLE|WS_BORDER,
CRect(40,10,80,50),this,IDC_MYEDIT1);
MyEdit2 = new CEdit();
if (MyEdit2!=NULL) MyEdit2->Create(WS_CHILD|WS_VISIBLE|WS_BORDER,
CRect(160,10,200,50),this,IDC_MYEDIT2);
if (MyButton!=NULL) MyButton->Create("=",WS_CHILD|WS_VISIBLE|SS_CENTER,
CRect(220,10,280,50),this,IDC_MYBUTTON);
MyEdit1->SetWindowTextA("2");
MyEdit2->SetWindowTextA("3");
}
CMainWnd::~CMainWnd()
{
if (MyStatic!=NULL) delete MyStatic;
if (MyButton!=NULL) delete MyButton;
if (MyEdit1!=NULL) delete MyEdit1;
if (MyEdit2!=NULL) delete MyEdit2;
}
class CMyApp : public CWinApp
{
public:
CMyApp();
virtual BOOL InitInstance();
};
CMyApp::CMyApp()
{}
BOOL CMyApp::InitInstance()
{
m_pMainWnd=new CMainWnd();
ASSERT(m_pMainWnd);
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
matrix a;
a.inmatrix();
cout << "beginning: "<<endl;
a.outMaTrix();
int i,j;
int z =1;
do
{
cout << "enter row to delete: ";
cin >> i;
cout << "enter col to delete: ";
cin >> j;
a.MaTrixdel(i,j);
cout << "do you want to continue? 1: yes, 0: no ";
cin >> z;
} while (z == 1);
return TRUE;
};
CMyApp theApp;
class matrix
{
private:
int m_Col;
int m_row;
int a[100][100];
public:
void inmatrix()
{
cout << "enter row: ";
cin >> m_row;
cout << "enter col: ";
cin >> m_Col;
for (int i=1; i<=m_row; i++)
{
for (int j=1; j<=m_Col; j++)
{
cout << "enter a["<<i<<"]["<<j<<"]: ";
cin >> a[i][j];
}
}
}
void outMaTrix()
{
for (int i=1; i<=m_row; i++)
{
for (int j=1; j<=m_Col; j++)
{
cout << a[i][j] << " " ;
}
cout <<endl;
}
}
void MaTrixdel(int i, int j)
{
cout << "matrix after deleted: \n";
if ((i<=m_row)&&(j<=m_Col)) {
for (int k=1; k<=m_row; k++)
{
for (int h=1; h<=m_Col;h++)
{
if (!(k==i||h==j))
{
cout<<a[k][h]<<" ";
}
}
cout <<endl;
}
}
else cout<<"error:you are not right\n";
}
};
|
|
|
|
|
kiemxai wrote:
void inmatrix()
{
cout << "enter row: ";
cin >> m_row;
cout << "enter col: ";
cin >> m_Col;
for (int i=1; i<=m_row; i++)
{
for (int j=1; j<=m_Col; j++)
{
cout << "enter a["<<i<<"]["<<j<<"]: ";
cin >> a[i][j];
}
}
}
Out of interest - have you ever heard of input parameter validation (i.e. making sure m_row and m_Col are valid).
Also - you may be interested to learn that arrays in C/C++ have index ranges of 0-(size-1) (i.e. 0-99 in your case), not 1-size.
I've got no idea about the MFC stuff - I'm not wading through all that.
Also - kiemxai wrote: This is the code which i did but algorithm fails...
'algorithm fails', you say - OK, what were you expecting it to do, and what did it actually do?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
you can say more specific,with you specific code should be like?
|
|
|
|
|
kiemxai wrote: you can say more specific,with you specific code should be like?
Not really - I don't know what your code is meant ot achieve - hopefully you know that...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I'm working with a large project with lots of classes and I have a problem with including the classes. I use include guards at the top of my .h files (I've tried using #pragma once as well) to prevent including more than once. When I include the header of a class I need to use I get an error saying "undefined class", if I was using a pointer I could use a forward declaration but I'm not using a pointer, how do I get around this?
Thanks.
|
|
|
|
|