|
It works now, it was the 32bit-alignment...
BMP files really are a mess!
|
|
|
|
|
under www.imagemagick.org there is a really good image library for free.
No one should nowadays work so low-level like using those Platform SDK image functions, if he can avoid them.
|
|
|
|
|
I would like to add icons to my menu popup items
I am using SDK.
|
|
|
|
|
Im writing an application that displays an image from a web cam on a CFormView. I derived CCamWnd from CStatic
and override OnPaint to display the image. I wanted to take it to the next step and have it handle a windows
message. For example a doubleckick would switch between zoomed in and normal mode. I cant seem to get
the messages passed through to my class. I can get messages passed through to a class derived from
CEdit without a problem.
What is the difference between these two classes...why do they behave differently.
Any comments or suggestions would be greatly appreciated.
Paul Galla
|
|
|
|
|
A static control will notify you of double-clicks, as long as it has the SS_NOTIFY style set. It will send a STN_DBLCLK notification to the parent window via a WM_COMMAND message.
|
|
|
|
|
Is this possible to do using MFC classes?
Either way, where can I find information about this (preferably with source examples...)?
/XTSea
|
|
|
|
|
I use raw Windows sockets.
How to check whether the other side of the connection is closed?
Thanks
|
|
|
|
|
hi,
i really need help in windows sockets, here is a function i wrote to connect to server:
//----------- Function Implementation --------------------------------
bool ConnectToSocket()
{
if (WSAVERNOTSUPPORTED == WSAStartup(MAKEWORD(2,0),&WSAData))
{
printf("WSAStartup Failed!\r\n");
return FALSE;
}//end if
else
{
printf("WSAStartup Success\r\n");
}//end else
// construct socket
sock = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if (sock == INVALID_SOCKET)
{
printf("Failed to construct socket!\r\n");
WSACleanup();
return FALSE;
}//end if
else
{
printf("Socket construction....Success\r\n");
}//end else
// fill in socket address struct and connect to server
sa.sin_family = AF_INET;
sa.sin_port = 23;
sa.sin_addr.S_un.S_addr = inet_addr("147.234.12.233");
int iErr = connect( sock,(SOCKADDR *)&sa,sizeof(sa));
return TRUE;
}
it doesn't seem to work ,i dont know why..... also how do i receive and send data????
please help me i am desperate!
tnx a lot
yaron
|
|
|
|
|
there are some possebilities
the first 1 is that the server is not up
you don't check errors at all
in the winsock.h there are list of errors
you can take the error value
(which is unsigned int)and send
it to acheckerror function
which does switch case over all the possebilities
and then know more specific what is
the problem
any way good luck
Rami Buchnik
|
|
|
|
|
I'm new to VC++
I'm working on a project that I took over from someone else.
It a stats program that reads data from a database and uses OleChart
to output a chart, well anyway when the program starts in debug
I get an Assertion failed message, Message is about strcore.cpp on line
519 and on line 479 what I have been doing is ignoring them and the
program loads fine but when I'm running the program and I click on
any of the combo boxs or radio buttons I get another assertion message
about winocc.cpp line 311. Now I don't expect you all to tell me what is worng
but if anyone else has seen this please respond.
BTW the program does work in debug but crashes in the release version ?
|
|
|
|
|
About the strcore.cpp-assertion: if you click on "retry" the debugger-ide jumps to this assertion.
In your debug window you can now switch through the contexts of the caller function; this way you
can find your source which is responsible for this assertion. Maybe you're trying to access a CString-buffer
which is empty or something like that.
About the winocc.cpp: just do it the same way. Run with F5, wait for the crash and check the caller
functions.
About the debug/release thingy: THIS is something really nasty and you will need a lot of luck to
catch such bugs. Sorry
Chris
|
|
|
|
|
I found the bugs in the release version
and I'm going to try what you said for the debug version.
But most of all thanks for replying.
cmpssp
|
|
|
|
|
Hi
How can I add an message handler for a item I added dynamically in an application's menu. Please help
|
|
|
|
|
Use the ON_COMMAND macro in the message map, like:
ON_COMMAND(IDC_NEW_MENU_ITEM, OnNewMenuItem)
And the function prototype is:
afx_msg void OnNewMenuItem();
|
|
|
|
|
Hi,
I'm writting a FTP Client, using CSocket. And i have problem with the reply format of LIST command.
I tried on some different kinds of FTP server (UNIX, WINDOWS, DOS model), and saw it not the same. Tried to guess the format, but failed.
Who can help me out of this? every suggestion would be appreciated.
Trieu Hai Nguyen
haitrieu@glassegg.com
|
|
|
|
|
Hi,
I too have tried deciphering the result of the LIST command for an FTP client. I even downloaded the latest FTP standard, and guess what, the response to the LIST command is not standard.
My current thought is just to write the data (whatever they send) to a log file that the end user can view. Then the end user can determine if the 'SEND' was successful or not.
If anyone else has a better answer, I'm all ears...
Jeff
|
|
|
|
|
Hi,
how can i add a horizontal scrollbar to the dropdown list of my combobox ?
SetHorizontalExtend() won't do anything, although i have added the style WS_HSCROLL.
Any idea?
TIA Chris
|
|
|
|
|
Hi Chris,
I think SetHorizontalExtent() works only with a combobox in edit+listbox mode, not a drop-down combo.
The problem is that a combobox is actually two controls together and you should set the WS_HSCROLL style of the listbox inside the combobox, which is not simple.
I can't help you more than this, sorry
Cheers,
Paolo.
|
|
|
|
|
Hello,
I've got a question regarding setup. I need to create a setup for my application and the application is using a SQL server to log some data. How do I install support for the SQL server (if required) and the DSN?
I would appreceate any tips or links to some documentation.
Matthias
|
|
|
|
|
hi,
see in the registery how the DSN is registered and in your install application, add the registery entries to your install application.......
hope this helps ya,
yaron
|
|
|
|
|
Now i want to open dialog for open many files , so i
'm programming that
char filter[] = "Contact Outlook(*.contact)|*.contact||";
CFileDialog fd(TRUE,NULL,NULL,OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY,filter);
After that i will get name of file that i select by coding
if(fd.DoModal() == IDOK){
POSITION p;
p = fd.GetStartPosition();
CString path;
do{
path = fd.GetNextPathName(p);
}while (path != "");
}
But it is error on run time , this program will pop up error-dialog when the program
do line => "path = fd.GetNextPathName(p);"
I think because when fd.GetNextPathName(p) got name of file finished and when it got agin
it does not return NULL but it can't call "fd.GetNextPathName(p)"
I worry about thing very much , Please help me .
Thank you for your help
|
|
|
|
|
I think that the problem comes from your use of the POSITION variable. You should use it like this:
POSITION p = fd.GetStartPosition();
CString path;
while(p){
path = fd.GetNextPathName(p);
...
}
It works like a CObList, for example...
HTH.
K.
|
|
|
|
|
Hi,
I want to set to the font and fontsize for my button and label without MFC. Can anyone pls tell me how to do it
|
|
|
|
|
Here's an example that makes the font bold. This is untested, and it's 3:25 AM, so please test before checking the code in.
HFONT hCurrFont, hNewFont;
LOGFONT lf;
hCurrFont = (HFONT) SendDlgItemMessage ( hMyDlg, IDC_MY_BUTTON, WM_GETFONT, 0, 0 );
GetObject ( hCurrFont, sizeof(LOGFONT), &lf );
lf.lfWeight = FW_BOLD;
hNewFont = CreateFontIndirect ( &lf );
SendDlgItemMessage ( hMyDlg, IDC_MY_BUTTON, WM_SETFONT, (WPARAM) hNewFont, TRUE );
|
|
|
|
|
Hi,
I want to set to the font and fontsize for my button and label without MFC. Can anyone pls tell me how to do it
|
|
|
|