|
Hmmm i have problem!
How can I copy a folder that have subfolder inside?
|
|
|
|
|
make the function(copy function) recursive.....keep it calling itself till there is no subfolder!!!!!
happy programmin.....
cheerz.....
|
|
|
|
|
|
|
|
Hi , I'm working with eMbedded Visual tool3 V3 .......
I want to use Shellexec func. .....
I tried it on visual studio 6 and it worked correctly without any problems or (including any additional files) , but in the eMbedded c++ , in the compiling , it says (UNDECLARED IDENTIFIER) although the autoComplete (ctrl + space ) gets me the function...
(is it required to include any header files ex: shellapi.h or refere to any dll ex: shell32.dll as MSDN says , I included the file but couldn't make anything with the dll)
The same is for WinExec func.
I need help please so quickly
|
|
|
|
|
You ought to be able to use CreateProcess to launch other applications.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
I have a dll file written in eVC++ 3.00 for PocketPC.
It is an api for a Hp PhotoSmart Built-In Camera. My task is to utilize this dll via Vb.NetCF.
There is a function in the dll called:
hpCamOpen()
This function is suppose to return a handle that is used to open the camera up to the other functions in the dll.
Here is some of the code from the source of the dll.
typedef HANDLE (*HPCAMOPEN)();
HPCAMOPEN HpCamOpen;
What I want to know is what does the "HANDLE" represent and what data type is it?
Thanks in advance.
-----------------------------
Noble D. Bell
www.noblesoftware.com
|
|
|
|
|
HANDLE = 32-bit unsigned integer.
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
HANDLE = 32-bit unsigned integer. or LONG or DWORD (you have to cast that)
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi,
HANDLE is Win32/64 Data type. This use to handle an object(Like Thread, Kernal objects,etc). It declares in winnt.h. This data type takes 32 bit when use 32-bit Operating System. This take 64-bit when use 64-bit operating system.
Regards,
Selvam
|
|
|
|
|
In the following code given below
void CMouseDlg::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
// for the left mouse click
if ( ( nFlags & MK_LBUTTON) == MK_LBUTTON)
{
CClientDC dc(this);
dc.SetPixel(point.x , point.y ,RGB(255,0,110) );
}
// for the right mouse click
if ( ( nFlags & MK_RBUTTON) == MK_RBUTTON)
{
CClientDC dc(this);
dc.SetPixel(point.x , point.y ,RGB(255,0,0) );
}
CDialog::OnMouseMove(nFlags, point);
}
This is a mfc program. This is simple drawing application using the mouse.
The problem is , when left button of the mouse is clicked and dragged on the dialog form red color is drawn on the dialog form.The same color is appears on the Dialog form when the right button of the mouse is clicked and drawn on the dialog form the same red color, even though the value of RGB value of the left button and RGB value of the right button are different as you can see from the above the code.
My question how can drawing with different colors for example
left button -> yellow color.
right button -> orange color.
Can anyone please help me regarding this matter?
PHILIP
|
|
|
|
|
i dunno if thiz will help!!!!!
why dont u use the CPen function???and attach it with the dc object.....
if making a simple drawing application is ur aim,u will find thiz useful......
herez the sample code.....
CDC dc(this);
CPen penz(PS_SOLID,1,RGB(255,0,0));
dc.SelectObject(&penz);
hope u find that useful!!!!!;)
happy programmin.....
cheerz.....
|
|
|
|
|
phijophlip wrote:
if ( ( nFlags & MK_LBUTTON) == MK_LBUTTON)
{CClientDC dc(this);
dc.SetPixel(point.x , point.y ,RGB(255,0,110) );
}
uSe
dc.SetPixel(point.x , point.y ,RGB(255,255,0) );<br />
phijophlip wrote:
if ( ( nFlags & MK_RBUTTON) == MK_RBUTTON)
{CClientDC dc(this);
dc.SetPixel(point.x , point.y ,RGB(255,0,0) );
}
dc.SetPixel(point.x , point.y ,RGB(251,199,19) );//Orange
Rest of you code is fine
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi all:
I have a Win32 Application project and when I compile it the following error messages generated!
_snprintf' : undeclared identifier
and when I uncomment it I get another error message
unresolved external symbol _WinMain@16
the programme entry is like this
VOID __cdecl _tmain(INT Argc,PTCHAR Argv[])<br />
{<br />
}
I wonder if that's because of the wrong compiler parametera or...?
BTW how can I run command-line programme in VC, in other words where should I input the parameters?Only can do that in DOS?
|
|
|
|
|
well for your first problem.... Win32 Apps have WinMain as there entry point function ( that is, WinMain is the function called when the app is loaded just as in normal c the main(..) function is called..) you have to define a WinMain(..) in your source somewhere for the exact prototype of the function refer to MSDN.
the second problem is even simpler.... in VC _exec(..) is used to execute command line programs... ( btw the better implementation would be to use ShellExec(...) API function ) check MSDN for further help.
Hope this helps..
Lid,.
|
|
|
|
|
The following code snips relate to code that successfully compiled using Visual Studio 6.0. This same implementation does not compile in Visual Studio .Net 7.0. Here is the error message
ConfigTSAControlsFView.cpp(200) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall CConfigTSAControlsFView::* )(UINT)' to 'void (__thiscall CWnd::* )(CWnd *)'
//Function Declaration
afx_msg void OnKillFocus(UINT uiCtrlID);
//Message Map Entry
ON_WM_KILLFOCUS()
//Function Implementation
void CConfigTSAControlsFView::OnKillFocus(UINT uiCtrlID)
{
//the code
}
Now this is what confuses me the most. The MSDN library implies that the OnKillFocus method takes a CWnd*, not a UINT. Visual studio 6.0, somehow was able to compile this and perform a cast. However, Visual Studio .net is complaining that the static_cast is not possible. So can someone explain to me how visual studio 6.0 can make the cast and why visual studio .Net cannot? The uiCntrlId is used in a switch statement so the actual value being used is equal to the resource Id of the window. How did visual studio cast from a CWnd* to a resource Id automatically? This seems like quite a stretch. If anyone has any ideas, I'd appreciate it.
Personally, I think the error message makes perfect sense. Of course the compiler won't cast from a CWnd* to a UINT that has a completely different meaning. I just can't imagine how the code ever compiled and worked with visual studio 6.0. The other thing is that if I change the code to use a CWND*, then it seems to invalidate the existing switch statements, within the function, that expects a controller id.
|
|
|
|
|
The Visual C++ 6 compiler was not particular standards-compliant, while the Visual C++.NET compiler is much moer compliant. There is a lot of code that compiles under Visual C++ 6 that won't compile under the .NET compiler (and vice-versa).
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Let me clarify my question. I need to understand why visual studio 6.0 was able make the static_cast so that I can understand how to get this code to work under visual studio.net. Obviously, visual studio .net is more standards compliant since it is complaining. Since I can't imagine how the compiler performs the implicit cast from CWnd* to UINT iResourceId, I have no idea how to do the cast manually. There must be a way.
|
|
|
|
|
Hi,
I have a CFormView doc/view app. I would like to be able to (at runtime) Create a CScrollView or some other view in its place.
Does anyone have any ideas?
Thanks,
|
|
|
|
|
|
Hello,
I'm very new to programming but have learned allot over the past few months. Here's my problem.
I have a program that I'm working on. It's written in C not C++ and it is GDI based. I'm using MS Visual Studio 2003. I have the ability to edit everything that is in the .rc file under the project such as dialogs, menus and ext. What I don't have the ability to edit is the items below the menu such as the pens and other visual designs that are contained within the main window of the program. It's not like VB or C# where you can just edit the main window from the IDE. I have no ability whatsoever to change the overall visual design or feel of the main body of the program other than manual editing of the code, for example:
// draw check box
// We select the brown pen anyway to make sure we have a valid value
// for hOldPen for later calls to SelectObject()
hOldPen = SelectObject( hDC, lpe->hBlackPen );
if ( !lpe->tracks[i].bData )
{
pts[0].x = pts[3].x = pts[3].x = ((hx[1]+1)/2 - 4) - lpe->dx;
pts[1].x = pts[2].x = pts[0].x + 12;
pts[0].y = pts[1].y = pts[4].y = rc.top + 1;
pts[2].y = pts[3].y = rc.top + 13;
Polyline( hDC, pts, 5 );
}
if ( lpe->tracks[i].bChecked && !lpe->tracks[i].bData )
{
SelectObject( hDC, lpe->hBlackPen );
pts[0].x += 3;
pts[0].y += 3;
pts[1].x = pts[0].x + 2;
pts[1].y = pts[0].y + 3;
pts[2].x = pts[1].x + 8;
pts[2].y = pts[1].y - 8;
Polyline( hDC, pts, 4 );
pts[0].x += 1;
pts[1].x = pts[0].x + 2;
pts[1].y = pts[0].y + 3;
pts[2].x = pts[1].x + 8;
pts[2].y = pts[1].y - 8;
Polyline( hDC, pts, 4 );
}
SelectObject( hDC, hOldPen );
}
SetBkMode( hDC, oldBkMode );
SelectObject( hDC, hOldFont );
EndPaint( hWnd, &p );
}
The code above is for displaying a simple checkbox for selecting items displayed within the main window. I have been able to modify the code to an extent but it takes allot off time and pulling out of hair Really what I would like to do is be able to change these things at least as easy as I can make changes in the .rc file under the MSVC resource editor. There has to be an easier way to make changes or additions besides what I'm now doing. Unfortionally, I'm not the original author of this program so I don't know what editor they used to compose the GUI.
Better yet, I would like to spice up my main window from the generic look it has now to something better as well as be able to add to it. Are there any libraries out there that would easily integrate into this GDI application? I really like the new Office 2003 look and feel.
I would very much appreciate any help I can get and thank everyone in advance for your time in helping me.
Jamie
|
|
|
|
|
This program works ok. I get an exe file. But I would like to be able to send the output to a printer. How would I be able to send the output from the exe file after running it, to a printer? I have some code by the forward slashes. Thank You
// RWA's and Charges
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <string>
using std::cout;
using std::cin;
using std::fixed;
using namespace std;
//#include
int main () //int,char*)
//ofstream printer ("lpt1:");
//Printer <<"test"<<endl;
//return 0;
//}
{
int c;
double fee;
double total;
char a ='y', ans;
string input;
int number;
while (a =='y'|| a =='Y')
{
cout << "\nChoose from options below.\n";
cout << "\nEnter A to calculate total RWA cost.\n";
cout << "\nEnter B to calculate RWA base estimate.\n";
cout << "\nEnter your choice, then press the enter key:\a";
cin >> ans;
cin.ignore();
if (ans == 'A' || ans == 'a' ){
cout << "\nEnter RWA Base Estimate, then press the enter key:$\a";
cin >> input;
cout << "You entered:$" << input << endl;
int pos = input.find(',');
while (pos != -1)
{
input.replace(pos, 1, "");
pos = input.find(',');
}
number = atoi(input.c_str());
fee = number * 0.04;
cout << fixed;
cout.precision(2);
cout << "4% Management Fee:$" << fee <<"\n";
total = number + fee;
cout << fixed;
cout.precision(2);
cout << "Total:$" << total <<"\n";
if (total >= 1 && total <= 2499)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.1 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.1) <<"\n";
}
if (total >= 2500 && total <= 9999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.09 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.09) <<"\n";
}
if (total >= 10000 && total <= 24999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.08 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.08) <<"\n";
}
if (total >= 25000 && total <= 49999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.07 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.07) <<"\n";
}
if (total >= 50000 && total <= 99999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.05 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.05) <<"\n";
}
if (total >= 100000 && total <= 299999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.03 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.03) <<"\n";
}
if (total >= 300000 && total <= 999999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.015 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.015) <<"\n";
}
if (total >= 1000000 && total <= 2425000)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.005 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.005) <<"\n";
}
}
if (ans == 'B' || ans == 'b') {
cout << "\nEnter Total RWA Cost, then press the enter key:$\a";
cin >> input;
cout << "You entered:$" << input << endl;
int pos = input.find(',');
while (pos != -1)
{
input.replace(pos, 1, "");
pos = input.find(',');
}
number = atoi(input.c_str());
fee = number * 0.04;
cout << fixed;
cout.precision(2);
cout << "4% Management Fee:$" << fee <<"\n";
total = number - fee;
cout << fixed;
cout.precision(2);
cout << "Total:$" << total <<"\n";
if (total >= 1 && total <= 2499)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.1 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.1) <<"\n";
}
if (total >= 2500 && total <= 9999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.09 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.09) <<"\n";
}
if (total >= 10000 && total <= 24999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.08 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.08) <<"\n";
}
if (total >= 25000 && total <= 49999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.07 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.07) <<"\n";
}
if (total >= 50000 && total <= 99999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.05 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.05) <<"\n";
}
if (total >= 100000 && total <= 299999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.03 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.03) <<"\n";
}
if (total >= 300000 && total <= 999999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.015 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.015) <<"\n";
}
if (total >= 1000000 && total <= 2425000)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.005 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.005) <<"\n";
}
}
cout <<"********************************************************************""\n";
cout <<"* Rate Range Subtotal Max. Range *""\n";
cout <<"* .01 .1 $2,499 $250.00 $250.00 *""\n";
cout <<"* 0.09 $2,500 $9,999 $675.00 $675.00 *""\n";
cout <<"* 0.08 $10,000 $24,999 $800.00 $1,200.00 *""\n";
cout <<"* 0.07 $25,000 $49,999 $1,750.00 *""\n";
cout <<"* 0.05 $50,000 $99,999 $2,500.00 *""\n";
cout <<"* 0.03 $100,000 299,999 $6,000.00 *""\n";
cout <<"* 0.015 $300,000 $999,999 $10,500.00 *""\n";
cout <<"* 0.005 $1,000,000 $2,425,000 $7,125.00 *""\n";
cout <<"********************************************************************""\n";
cout<<"Would You Like to Perform Another Calculation (Y/N)?\a";
cin>> a;
}
cout <<"\nGoodBye\n";
getchar();
return 0;
cin >> c;
}
|
|
|
|
|
Hello all
I am very very new to this and I have to debug this problem and I really need your help.
The problem is that there is client and sever application which are coomunicating. When the server goes down, I like to print a warning in the client.
I know that recive will get a 0 return value when the connection is lost but in my case, it seems like I don't even get there. the program is run through a GUI and in Run function, there is loop like:
while(PeekMessage(&msg, 0, 0, NULL, PM_REMOVE))
{
if(msg.message == MSG_UPDATE_TCPIP_CONNECTIONS)
{
m_ServerIPAcceptDlg.Refresh();
m_TCPSummaryDlg.Refresh();
OnUpdateIP();
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
DispatchMessage function goes throught some MFC codes and then calls the recive. When the connection is lost the DispatchMessage does not call the recive function anymore.
I am guessing ( I could be wrong as I am very very new to this) that there should be message that I can get that tell me the connection was lost and then print this message.
I have looked every where on line for a list of msg.message types to look and can not find what type of messages are available to me.
Please help me as this is very important to me. If you know a good on line refrence book or any good book that can help me with MFC networking and programing, please let me know.
Thank you kindly for all your helps.
|
|
|
|
|
back to top, Any help is greatly appritiated.
|
|
|
|
|