|
javad_2005 wrote:
1-How to create a function like enumWindows?
Although less reliable, you could try using GetWindow() in a loop.
javad_2005 wrote:
2-How to use crystal report 10 in mfc?
I believe they have an SDK. Have you looked into that?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Please help me create resource DLL that can contain alpha color icon.
Thank!
|
|
|
|
|
Hi 2 all,
I have an MDI Application, the problem with it is that whenever i open a file registered with my app from the explorer... it creates a new instance of my application. I want to make sure that whenever a file is loaded from windows explorer it is loaded in the previous instance ( if there is any )...
please help asap.
Lid.
|
|
|
|
|
Check out this article, as well as this one.
Shog9
I'm not the Jack of Diamonds... I'm not the six of spades.
I don't know what you thought; I'm not your astronaut...
|
|
|
|
|
i am currently handling a project using window programming that also support client server technology. in my project, i need to assure when a client click on the menu, the server will do what the client request. i just couldnt figure how to run few client programs that can control the server program. if multiple giving commands at the same time. what will happen. i really have no idea. hope someone can help me.
blurblur kf
|
|
|
|
|
Hi!
is there some kind of events we can use to know when a new process is running?
thanks!
|
|
|
|
|
Can any body give me a how or a sources code to implement a right click function which show a drop down menu on item in ClistCtrl ??
Nobody is Lonely
|
|
|
|
|
catch the Right Button Click on CListCtrl and using TrachPopupMenu api display the Menu on the CListCtrl.
just Check the documentation of TrackPopupMenu in local copy of MSDN it's contain the example for displaying the popupmenu
"I Think this Will Help"
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
i have add this command from msdn library, but it have some errors...
void CMCSProjectDlg::OnRButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CView::OnRButtonDown(nFlags, point);
CMenu* menu_bar = AfxGetMainWnd()->GetMenu();
CMenu* file_menu = menu_bar->GetSubMenu(0);
ASSERT(file_menu);
file_menu->TrackPopupMenu(TPM_LEFTALIGN |TPM_RIGHTBUTTON, point.x,
point.y, this);
}
ERROR:
error C2248: 'OnRButtonDown' : cannot access protected member declared in class 'CWnd'
: see declaration of 'OnRButtonDown'
: error C2352: 'CWnd::OnRButtonDown' : illegal call of non-static member function
: see declaration of 'OnRButtonDown'
Error executing cl.exe.
What d' problem ??
Nobody is Lonely
|
|
|
|
|
Hello everyone.
I have a dialog attached in a frame, the propery of dialog is "child", in the dialog there are some edit boxs, comboboxs and buttons. When these controls in dialog got focus, I want to catch the active event. I tried to add WM_ACTIVE to dialog, but it can not be called. How to know when the dialog is activated?
Thanks.
-Freehawk
|
|
|
|
|
When these controls in dialog got focus, I want to catch the active event.
for that u can use EN_KILLFOCUS and EN_SETFOCUS events of edit box
|
|
|
|
|
How can I connect to a SQL/MSDE database. I figured I couldn't use CDaoDatabase since it's not an Access database that I want to connect to. Is this the connection I should use?
strConnect = _T("Provider=sqloledb;Data Source=MyServerName;"
"Initial Catalog=MyDatabaseName;"
"User ID=myUsername;Password=myPassword;");
Now how do I use this string to connect and query my database?
Thanks!
|
|
|
|
|
Have you considered using ADO?
|
|
|
|
|
Yes but isn't using ADO in C++ very complex? My program isn't COM-based so it may be a little difficult to implement. Are there other alternatives to using ADO?
|
|
|
|
|
I'm using ADO in my app and to be honest I don't even know what COM is. I didn't find it very difficult, I'm not aware of easier alternatives (but I'm no expert). This article was very helpful to me:
http://www.codeproject.com/database/simpleado.asp[^]
If you have any more questions I'd be glad to help but we should probably move this over to the SQL/ADO/ADO.NET message board.
|
|
|
|
|
Thanks Wilsonian! I'll try it out and if I'm still having problems I'll post it in the SQL/ADO/ADO.NET board. Thanks again!
|
|
|
|
|
Hello,
I'm using the following code to create database programatically, and it works only on WinXP, it crashesh on win98/ME/2000:
CDaoDatabase db;<br />
db.Create(_T("tmp.udb"));<br />
CDaoTableDef TableDef(&db);<br />
TableDef.Create(_T("Addresses"));<br />
TableDef.CreateField(_T("AddressID"), dbLong, 4, dbAutoIncrField);<br />
TableDef.Append();<br />
db.Close();
with error from daocore.cpp -> line:453
What am I doing wrong?
|
|
|
|
|
Im looking for a method of get the effective size of a dinamic array created with the new statement, because the sizeof instruction only gives me the size of the pointer or the size of the first element of the array, maybe that i don't know how use that, but i really want to know the size of an array without having the number of elements of the array, (if it's posibble) the same as UBound property in VB6.
PS: excuse if this text is a little confuse, i'm from argentina and my english is basic.
Thanks
|
|
|
|
|
Either the class that you use to create your dynamic array has member functions to check the size, or it doesn't. What class are you using to create your dynamic array?
|
|
|
|
|
What i want to do is something as:
char c[255];
int size;
int * myArray=new c;
size=Ubound(myArray); // this is the function what i like
// I do it any times and i want to know it size
// I need to know the lenght of the array, then i know if i can add another
// to the array.
|
|
|
|
|
The C++ inside me says:
Better to use some class for holding the array (what about ready-to-use stl::vector ?) that could return you the size of the array by using something line myArray.size() ? You will also get the automated memory management included and many more other stl usefull functions.
The C devil says:
on most compilers, the size of the array is stored at some negative offset of the array (but differs on compilers, also can differ on compiler versions etc - simply don't try it at home, it's ugly ugly ugly hack - just mentioned in case of emergency)
|
|
|
|
|
What you are after is not possible. You could pull it off while in debug mode, but the same trick would not work in release mode.
When you dynamically allocate memory, the amount requested is usually stored in a variable or a #define directive.
char *buff = new char[255]; Now whenever buff is used by other functions, the value 255 must also be sent to those functions. Make sense?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi Guys
I have to convert a IP-Address which is a CString to an UInt, but i have no clue how to do this. Also i must convert a Port CString to an UInt.
MFG
RedDragon2kx
Unix and C are the ultimate computer viruses.
|
|
|
|
|
don't you use a class that use ip addresses, and in which some function take a string (either char* or std::string or CString...) ?
else, you might write your own function that test first the validity of the address, and then, extract it to a UInt...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You can sscanf the string like so:
CString sIPAddr;
UINT nByte1, nByte2, nByte3, nByte4;
UINT nPort;
DWORD dwIPAddr;
int nArgs = sscanf( (LPCTSTR)sIPAddr, "%d.%d.%d.%d:%d",
&nByte1, &nByte2, &nByte3, &nByte4, &nPort );
if( nArgs != 5 )
{
}
else
{
...
...
dwIPAddr = (nByte1 << 24) + (nByte2 << 16) + (nByte3 << 8) + nByte4;
}
You may want to verify my byte ordering (nByte4 may be the high byte) when building the dwIPAddr, but this should do the trick.
Bob Ciora
|
|
|
|