|
Does it always show one more than is being added?
"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
|
|
|
|
|
No Alwayes show one extra.
|
|
|
|
|
Hi,
I have taken an MDI application and overriden the Childframe's OnCreateClient
if (!m_mdiSplitWnd.CreateStatic(this, 2, 2,WS_CHILD | WS_VISIBLE|AFX_WS_DEFAULT_VIEW ))
{
TRACE0("Failed to CreateStaticSplitter\n");
return FALSE;
}
m_mdiSplitWnd.CreateView(0,0,RUNTIME_CLASS(CMyEditView),CSize(100,100),pContext);
m_mdiSplitWnd.CreateView(0,1,RUNTIME_CLASS(CSpreadSheetview),CSize(100,100),pContext);
m_mdiSplitWnd.CreateView(1,0,RUNTIME_CLASS(CSpreadSheetview),CSize(100,100),pContext);
m_mdiSplitWnd.CreateView(1,1,RUNTIME_CLASS(CSpreadSheetview),CSize(100,100),pContext);
RecalcLayout();
After running the application I am unbale to find a splitter in the childwnd ,hovering my mouse on I could notice the Splitters panes and Spreadsheet Ax Control in one of the views are partially visible.Also I could notice the splitter window is not sized when my childframe is maximized.
What Should I do to make my splitter window clearly visible and also to be resized with respect to childframe?
Thanks
Satya
Today is a gift, that's why it is called the present.
|
|
|
|
|
Hi All,
Good Morning.I am doing one ATL Based VC++ Program. And i want to generate reports using crystal report.This i tried in normal VC++ MFC program but when i tried with ATL Program it is giving error and i created one more ATL program in that i got error like "you can not add ActiveX Control in your project".So i want to know that is it possible to add any activex control to ATL Program or not? If it is possible then how can i do it please give me some hints. Otherwise please tell me anyone how to do reporting in ATL Based program?
Please help me.
Thanks in Advance,
Savitri P 
|
|
|
|
|
I'm trying to built a windows app that sits on the system tray and pops up notification messages based on a pre-determined interval. It will be similar to how Yahoo Messanger notifies when someone on the contact list goes online/offline. I've managed to get my app to sit on the system tray, but no idea on the notification messages. Is it a dialog, or is it something else?
|
|
|
|
|
I don't know about notification dialog but you may find some help from ShowBalloon & SetNotificationWnd api of CSystemTray .
Here[^] is one article related to this topic you may find useful.
Do not trust a computer...
Always check what computer is doing
regards,
Divyang Mithaiwala
Software Engineer
|
|
|
|
|
eight wrote: ...but no idea on the notification messages.
See about halfway down this article.
"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
|
|
|
|
|
How can I get all folder names if specified folder, lets say "c:\new folder\" I want names of the all folder in new folder
|
|
|
|
|
|
|
Use FindFirstFile and FindNextFile.
The WIN32_FIND_DATA member dwFileAttributes will tell you if the file is a directory.
Cheers, Ronald.
|
|
|
|
|
Hi Everybody,
I have created one dialog based application and that is interacting with mysql database through DNS. I want to create setup now. But I dont know how to create setup for my mysql database. Pls help me.
|
|
|
|
|
I wish to set alternate colors on different rows in list view control.
Can anyone show me how to set background color at row in list view control (in report mode) in VC6++?
Thanks in advance.
*12Code
modified on Friday, April 10, 2009 12:27 AM
|
|
|
|
|
|
Hi all,
got a question thats bugging me. I can not figure out this very simple compile error I am getting. Here is the error:
C:\Documents and Settings\mininet\My Documents\C++\9APR09\test.cpp In function `int main()':
28 C:\Documents and Settings\mininet\My Documents\C++\9APR09\test.cpp expected primary-expression before "GetLocalComputerName"
28 C:\Documents and Settings\mininet\My Documents\C++\9APR09\test.cpp expected `;' before "GetLocalComputerName"
I know its related to the string. but what is wrong with it? If you tell me whats wrong, dont just tell me. Please include a description of why the string is messed up. Thank you in advance! Code is as follows:
<code>// Project 01 by Rob
#include <iostream>
#include <string>
#include <windows.h>
using namespace std;
int main()
{
system("CLS");
string password;
string GetLocalComputerName;
cout << "password: ";
cin >> password;
if (password == "123"){
system("CLS"); // Cleares the screen
cout << "password accepted" << endl;}
else{
cout << "password incorrect" << endl;
goto exit;}
exit:
system("CLS");
system("TITLE Local Computer Name");
string GetLocalComputerName()
{
TCHAR chrComputerName[MAX_COMPUTERNAME_LENGTH + 1];
string strRetVal;
DWORD dwBufferSize = MAX_COMPUTERNAME_LENGTH + 1;
if(GetComputerName(chrComputerName,&dwBufferSize)) {
strRetVal = chrComputerName;
} else {
strRetVal = "";
}
return(strRetVal);
}
//std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\y' );
return 0;
}
V/R
Rob
|
|
|
|
|
rbwest86 wrote: string GetLocalComputerName()
What is this?
"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
|
|
|
|
|
it is a string, i could have called it anything. But I kept it familiar with the function. All I am trying to do is retrieve the local computer name.
|
|
|
|
|
rbwest86 wrote: it is a string...
No, it's the beginning of a nested function, which is not allowed.
"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
|
|
|
|
|
Hello Rob,
You've defined GetLocalComputerName() inside main() . Nested function definition is illegal. So move GetLocalComputerName() outside to resolve the error.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
First off thank you very much. I read into the embeded function and your right, it will not work.
I do however feel there is something missing. I relocated the entire section related to retrieving the local computer name, to outside int main().
I think there needs to be
#include <fstream>
and have string GetLocalComputerName; cin >> or output somehow. Because the program compiles, yet it dosent seem as if it is doing anything. After I type in the password, it should jump to the next sequential portion of the program, and retrieve the username. It does nothing but stare back at me. I feel as if I am missing something, can someone point me in the right direction? I do a lot of reading but the reading needs to be put into perspective. Thank you very much in advance.
V/R
Rob
|
|
|
|
|
Hi Rob,
You should call GetLocalComputerName() function and print it. For instance, see the corrected code snippet.
#include <iostream>
#include <string>
#include <windows.h>
using namespace std;
string GetLocalComputerName()
{
TCHAR chrComputerName[MAX_COMPUTERNAME_LENGTH + 1];
string strRetVal;
DWORD dwBufferSize = MAX_COMPUTERNAME_LENGTH + 1;
if(GetComputerName(chrComputerName,&dwBufferSize)) {
strRetVal = chrComputerName;
} else {
strRetVal = "";
}
return(strRetVal);
}
int main()
{
system("CLS");
string password;
cout << "password: ";
cin >> password;
if (password == "123"){
system("CLS");
cout << "password accepted" << endl;}
else{
cout << "password incorrect" << endl;
goto exit;}
exit:
system("CLS");
system("TITLE Local Computer Name");
cout << GetLocalComputerName();
return 0;
}
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
I'm looking at using some of the new stuff that comes from the MFC Service Pack in our current application (possible release date for this is late this year, so it's not urgent)
We have at least one resource ID conflict between our resources and the new resources in the Service Pack.
for example :
our code:
#define IDS_MESSAGE_FORMAT 17018
MFC code:
#define IDS_AFXBARRES_ADD_REMOVE_BTNS 17018
What's the best strategy to clean up resources to prevent/limit/remove conflicts ?
I have used ResOrganiser[^] and it works ok, but looking for preentive solutions.
Thanks.
Max.
This signature was proudly tested on animals.
|
|
|
|
|
The code I'm writing is designed to read into a Smart Card Reader. However, I've having a most difficult time trying to just setup the connection and get the filename so I can use CreateFile.
I've looked at the MSDN Library and done countless searches on the topic and have seen various things. Some people allocate the SP_DEVICE_INTERFACE_DETAIL_DATA struct, and claim it works, and some don't and they also claim it works (Both of which do not work for me).
The current way my code is set up right now pulls the required size, but when it goes to fill in the struct, the program freezes. Quite frustrating, really.
So here's my question: What must I do to the struct prior to attempting to fill it in with SetupDiGetDeviceInterfaceDetail in order to pull up *->DevicePath ??
Here's the code:
....
//declarations
int n=0, result;
char af[80]="";
bool found=FALSE;
GUID SCRGuId;
DWORD requiredsize=0;
HDEVINFO hDevInfo=NULL;
SP_DEVICE_INTERFACE_DATA DeviceInfoData;
PSP_DEVICE_INTERFACE_DETAIL_DATA DevDetailInfoData;
....
do
{
if(SetupDiEnumDeviceInterfaces(hDevInfo, NULL, &SCRGuId, n, &DeviceInfoData))
{
found = TRUE; requiredsize = 0;
SetupDiGetDeviceInterfaceDetail(hDevInfo,&DeviceInfoData,NULL,0,&requiredsize,NULL);
sprintf(af, "reqsize: %d", requiredsize);
SendDlgItemMessage(hWnd, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM)(LPCSTR)af);
if(requiredsize != 0)
{
//this is the problem code...can anybody help me here?
DevDetailInfoData->cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
SetupDiGetDeviceInterfaceDetail(hDevInfo,&DeviceInfoData, DevDetailInfoData,requiredsize,0,NULL);
sprintf(af, "device path %s", DevDetailInfoData->;DevicePath);
SendDlgItemMessage(hWnd, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM)(LPCSTR)af);
}else{
....
|
|
|
|
|
I use this approach when querying audio devices using the ANSI API's ...
<pre>
// Get details for the device registered in this class
DWORD size = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA) + MAX_PATH * sizeof(WCHAR);
// use vector so it will clean up afterwards
std::vector<BYTE> buffer(size,0);
// set up the pointer
SP_DEVICE_INTERFACE_DETAIL_DATA* pDevInterfaceDetails =
reinterpret_cast<SP_DEVICE_INTERFACE_DETAIL_DATA*>(&buffer[0]);
// let SetupDi know how big a buffer we have ...
pDevInterfaceDetails->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
// get the device path ...
if (!SetupDiGetDeviceInterfaceDetail(hDevInfo,&DID,pDevInterfaceDetails,size,NULL,&DevInfoData))
{
continue;
}
Apologies for CP formatting ...
Jerry
|
|
|
|
|
Thank you thank you thank you! Jerry, despite the CP formatting, you just helped me solve my problem! Thanks!
|
|
|
|