|
Patje wrote:
for a new project we want to make use of whatever hot technology there is around, as long as it allows us to make a sexier user interface, program faster, and be future-proof.
That is the wrong criteria for choosing a development tool!
It all depends on the kind of application you are writing, if it is web based then certainly look at .NET as C#/ASP.NET makes writing web-apps easier than using ASP.
If it is a desktop app, will it be using a complicated GUI. At the moment, I feel Windows forms in .NET lacks a lot of the nice features that MFC has. If you have time to write a lot of the code yourself then Windows Forms with C# is certainly viable. If you haven't got the skillsets for filling in the gaps in Windows Forms then I'd stick with MFC.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
hi...
i guess it depends on the app ?
if it is a client/server app..then u cannot expect ur clients - atleast now - to have the .NET framework on their machines
if it is a web app, then i would suggest that you would go for .NET.
personal suggestion - I guess MFC has lost its relevance with the advances made by VB...5yrs back MFC gave u more flexibility..but now I guess both are even..and VB is FASTER to develop..
There are no failures; there are only extended learning opportunities.
|
|
|
|
|
I use it to display the picture file,when the user click a pic file from the list,then display it.But I found sometimes when I clicked several files ,the application will not response,the CPU usage is 100%.
When I debug it ,it caused an AsynFilt.dll Exception,but from the callstack I cannot found the reason.
It doesnot be the same,sometimes it works well.
So why can this BE?
Thank you
|
|
|
|
|
Hi,
I have written MFC Dilaog based application.In that i want
check if my window is gone out of the screen?
Regards
Neha
|
|
|
|
|
GetWindowPos
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hi,
does someone knows how to get a nice hyper link cursor that also works for XP (I mean with that neat shadow effect, is system is Windows XP). I use currently this code, but it does not produce a shadow on XP. thanks for feedback.
void SetDefaultLinkCursor(HCURSOR &hLinkCursor)
{
if (hLinkCursor == NULL)
{
CString strWndDir;
GetWindowsDirectory(strWndDir.GetBuffer(MAX_PATH), MAX_PATH);
strWndDir.ReleaseBuffer();
strWndDir += _T("\\winhlp32.exe");
HMODULE hModule = LoadLibrary(strWndDir);
if (hModule) {
HCURSOR hHandCursor = ::LoadCursor(hModule, MAKEINTRESOURCE(106));
if (hHandCursor)
hLinkCursor = CopyCursor(hHandCursor);
}
FreeLibrary(hModule);
}
}
|
|
|
|
|
|
ah thx! the symbol wasn't defined on ME, but works now...
|
|
|
|
|
Some tables in oracle(8.0.6) are not allowed add whereas others using ado control can add records when i do
RecordeSet->AddNew();(using Ado),There's a error message box.I don't know the cause.Help me please.
|
|
|
|
|
What is the error?
I personally find it better on Oracle to use stored procedures for inserting records.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
I have created an MDI application. In this application, I have a class CMyDoc,which is inherited from CDocument.
Now I want to write some code to open a document of this kind, while not showing the frame and view which are associated with the document.
I write these codes:
{
...
CMyDoc * pDoc=(CMyDoc*)theApp.OpenDocumentFile(m_strNewFileName);
...
}
As you can guess,the frame and view are showed.Please tell me how to open a document without showing the frame and view .
I love sea
|
|
|
|
|
If you didn't open the view, how would the document be shown ? The point of a view is that it's how a document is rendered.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
To Christian,
First thank you very much for your reply!
Yeah,I agree about what you have said. But what i want to do now, is to read
~~~~~
the content of a document.And I donot want that the view and frame are to be
~~~~~~~~~~~~~~~~~~~~~~~~~
showed.
Let us take an example: Suppose that you are going to load the content of a *.txt file. Must you run an notepad.exe? No. You can make it by writing such codes:
CStdioFile f(...);
Do you catch what i mean?
I love sea
|
|
|
|
|
Ah - what is the document ? If it's a custom thing, abstract the loading code into a class, then you can call it from where-ever you like.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hi,
I am developing an application to send message to colleagues in our LAN. I hope they receive msgs with their Messenger Service in Win2K.
Now I used ShellExecute("net send...") to send message. And it works. But I don't know how to determine if my application succeeds in sending message.
My second question is, what tcp or udp port does Messenger Service use? Or it uses mailslot?
May I use some APIs to send message to this service directly? I am studying API NetMessageBufferSend(). But I am not sure it is fit for me and how to use it.
Any advice? Thank you.
Dave
|
|
|
|
|
|
I am a novice to Visual C++ and windows programming, and so am attempting to acquire my understanding of it from Charles Petzold's: Programming Windows. No doubt many of you are familiar with it.
I am becoming confused in using the SetDIBitsToDevice function that I am using to display bitmaps, that I have imported as a resource in the executable.
And, so I have several questions about pointers, handles, and casting.
In his book, Petzold describes supplying the necessary parameters, when calling the SetDIBitsToDevive function:
"For the SetDIBitsToDevice and StretchDIBits functions, the information you need includes a pointer to the BITMAPINFO structure of the DIB. As you'll recall, the BITMAPINFO structure comprises the BITMAPINFOHEADER structure and the color table. So, this is simply a pointer to the packed DIB with appropriate casting." Do any of you understand what he is referring to when he says, 'appropriate casting'?
Also, another question: I would like to display the bitmaps by using the FindResource and LoadImage function calls, which both return handles. Is there a way to use handles either as pointers, or by converting them safely to appropriate BITMAPINFO pointers and as pointers to the actual bitmap image bits? Is there a preferred casting operator that be used here?
This is a description of how the author acquires the pointer to the image pixel bits:
"The functions also require a pointer to the pixel bits. This is derivable from information in the information header, although the code is not pretty. Notice that this pointer can be calculated much more easily when you have access to the bfOffBits field of the BITMAPFILEHEADER structure. The bfOffBits field indicates the offset from the beginning of the DIB file to the pixel bits. You could simply add this offset to the BITMAPINFO pointer and then subtract the size of the BITMAPFILEHEADER structure. However, this doesn't help when you get a pointer to a packed DIB from the clipboard, because you don't have a BITMAPFILEHEADER structure."
I imagine a n umber of you folks write programs for image processing, and have an intimate understanding of the mechanics involved here. I would appreciate any information. Thanks.
|
|
|
|
|
hi,
about casting
see to the structure
typedef struct tagBITMAPINFO {
BITMAPINFOHEADER bmiHeader;
RGBQUAD bmiColors[1];
} BITMAPINFO;
BITMAPINFO is almost same as BITMAPINFOHEADER
casting means
int iVar = 1;
short sVar = (short)iVar; //I cast iVar to sVar
int SetDIBitsToDevice(
HDC hdc, // handle to device context
int XDest, // x-coordinate of upper-left corner of
// dest. rect.
int YDest, // y-coordinate of upper-left corner of
// dest. rect.
DWORD dwWidth, // source rectangle width
DWORD dwHeight, // source rectangle height
int XSrc, // x-coordinate of lower-left corner of
// source rect.
int YSrc, // y-coordinate of lower-left corner of
// source rect.
UINT uStartScan, // first scan line in array
UINT cScanLines, // number of scan lines
CONST VOID *lpvBits, // address of array with DIB bits
CONST BITMAPINFO *lpbmi, // address of structure with bitmap info.
UINT fuColorUse // RGB or palette indexes
);
.h
CBitmap m_bmpLogo1;
CString m_strLogoPath;
HANDLE m_hBitmap;
.cpp
::OnCreate()
CFileFind filefind;
CString strVal = strCurrentPath +"label.bmp";
m_strLogoPath = strVal;
if (filefind.FindFile(strVal))
bLogo = TRUE;
else
m_strLogoPath = "";
if(bLogo)
{
if(!m_bmpLogo1.LoadBitmap(strVal))
{
m_hBitmap = LoadImage (NULL,m_strLogoPath,IMAGE_BITMAP,0,0,
LR_DEFAULTSIZE | LR_LOADFROMFILE ); //| LR_CREATEDIBSECTION
if(!m_bmpLogo1.Attach(m_hBitmap))
m_strLogoPath = "";
}
}
//another function
CBitmap bmp //class
BITMAP Bitmap; //handle
long cx=0,cy=0;
CSize size
bmp.Attach(m_hBitmap);
bmp.GetBitmap(&Bitmap);
size = bmp.GetBitmapDimension();
cx = size.cx; //or Bitmap.bmWidth
cy = size.cy; //or Bitmap.bmHeight
BITMAPINFO info;
ZeroMemory( &info.bmiHeader, sizeof(BITMAPINFOHEADER) );
info.bmiHeader.biWidth = cx; // Set size you need
info.bmiHeader.biHeight = cy; // Set size you need
info.bmiHeader.biPlanes = 1;
info.bmiHeader.biBitCount = 24; // Can be 8, 16, 32 bpp or other number
info.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
//..
//I never used SetDIBitsToDevice() so i give you another example function
//Let's create a new bitmap
HDC dc= CreateCompatibleDC(NULL);
VOID *pvBits;
HBITMAP oldBmp;
m_hNewbmp = CreateDIBSection( dc, &info, DIB_RGB_COLORS, &pvBits,NULL, 0);
oldBmp = (HBITMAP)SelectObject(dc,m_hNewbmp);
//..
delete dc;
hope it helps a bit,
dan
|
|
|
|
|
Hello everyone!! Ok I got the bool loop done....now my only question is how do I get my program to repeat until 'E' is entered....I don't know if I'm supposed to put the void functions in the other.....PLease Help.....
#include <iomanip>
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
void PrintInstructions (float&, string&, float&);
void GetSingleTransInfo(char&, float&);
void ProcessDeposit (float, float, float&);
void ProcessCheck (float, float, float&, float&);
void PrintFinalTotals ();
void PrintBlankLines (int);
const float CHECK_CHARGE = .15f;
const float DEPOSIT_CHARGE = .10f;
const float ONE_TIME_CHARGE = 5.00f;
int main ()
{
string month;
float balance;
float transAmount;
char transCode;
float charge;
float currentBalance;
PrintInstructions (balance, month, charge);
GetSingleTransInfo (transCode, transAmount);
if (transCode == 'C')
{ ProcessCheck(transAmount, balance, currentBalance, charge);
}
if (transCode == 'D')
ProcessDeposit(transAmount, balance, currentBalance);
else
cout <<" This is the end of the month\n";
return 0;
}
void PrintInstructions(/*out*/ float& beginBalance, /*out*/ string& month, /*out*/ float& charge)
cout << "Please enter the month to be balanced: ";
cin >> month;
cout << endl;
cout << "Please enter the beginning balance for the month: ";
cin >> beginBalance;
below500 = (beginBalance < 500.00);
if (below500)
{
charge = ONE_TIME_CHARGE;
}
PrintBlankLines (3);
system ("pause");
system ("cls");
void GetSingleTransInfo (/*out*/ char& code, /*out*/ float& amount)
PrintBlankLines (4);
cout << " Select form the following transactions:\n\n";
cout << " C / c - for a check\n";
cout << " D / d - for a deposit\n";
cout << " E / e - for end of the month\n\n";
PrintBlankLines (3);
cout << "Enter you transaction choice: ";
cin >> code;
code = toupper (code);
cout << endl;
while (code != 'C' && code != 'D' && code != 'E')
{
cout << "\nError.....you must select a code from above\n\n";
cout << "Please enter a new transaction code: ";
cin >> code;
cout << endl;
code = toupper (code);
}
if (code == 'C' )
{
cout << "Please enter transaction amount: ";
cin >> amount;
cout << endl;
}
if (code == 'D')
{
cout << "Please enter transaction amount: ";
cin >> amount;
cout << endl;
}
system ("pause");
system ("cls");
}
//***************************************************************************************************************
void ProcessCheck(/*in*/ float amount, /*in*/ float balance,
/*out*/ float& currBalance, /*out*/ float& charge)
// Purpose: Deduct amount of check from balance....apply charges if balance falls below zero by
// cause of check. Apply charge if balance falls below $500.00.
// Pre:
// Post:
{
bool below500;
currBalance = balance - amount;
below500 = (currBalance < 500.00);
cout << " Check Transaction\n\n\n";
cout << fixed << setprecision (2) << endl;
cout << "Check Amount: " << amount << endl;
cout << "Current Balance: " << currBalance << endl;
cout << "Check Charge: " << CHECK_CHARGE << endl;
if (below500)
{
charge = ONE_TIME_CHARGE;
cout << "One Time Below $500.00 charge: " << charge << endl;
}
GetSingleTransInfo (transCode, transAmount);
system ("pause");
system ("cls");
}
//***************************************************************************************************************
void ProcessDeposit (/*in*/ float amount, /*in*/ float balance,
/*out*/ float& currBalance)
{
currBalance = balance + amount;
cout << " Deposit Transaction\n\n\n";
cout << fixed << setprecision (2) << endl;
cout << "Deposit Amount: " << amount << endl;
cout << "Current Balance: " << currBalance << endl;
cout << "Deposit Charge: " << DEPOSIT_CHARGE << endl;
}
Thanks in advance!!
Autumn
|
|
|
|
|
while((_getch()!="e") || (_getch()!="E"))
{
blah blah blah;
}
would be the easiest way of getting it to run until E is pressed.
|
|
|
|
|
That's helps alot Carrie....I jus don't know where to put it....if I put it in the main....it get a never ending loop!!! Thanks
Autumn
|
|
|
|
|
shouldn't that be && ? _getch() will always != 'e' || != 'E'.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
now Christian...dont' go off confusing me tonight!!! I hope your Thansgiving was well.... So how/ where in my program is this loop supoosed to be. It will run through once but that is all... Do I need to move things around? I'm lost please help!!
Autumn
|
|
|
|
|
Place the loop around all of your code that you want to repeat.
Also change the loop from above to this.
char ch = _getch();
while (ch != 'e' && ch != 'E')
{
...
}
because the way it is written above it will call getch two separate times and remove two separate characters.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
/me hangs her head
Yeah, you're right. It was made after midnight though so I think I'm excempt from the public flogging
|
|
|
|
|