|
srija wrote: Is it possible to create a Bitmap in C or should i use VC++ dialog based application only? Is there any special function?
Yes, you can create a bitmap in Plain Old C. Have a look at all the bitmap structures in MSDN.
But what are you wanting to do with the bitmap you created ?if your program only read data and create the bitmap manually, and save it back to a file, you can use paint.exe ( or any other bitmap/image viewer ) to see the resulting image.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
am having bitmap DLL, but it is based on MFC? how could i use for Visual C?
|
|
|
|
|
Hi!
I extracted alot of images from a mpg file.I want to create
an avi file from these images but I don't know how.
Can any one help me?!!!
Thank!!!
|
|
|
|
|
hi, how can i detect the last start of my windows (date and time)
is there a function or a reg-key available ?
best regards
emmi
|
|
|
|
|
GetTickCount()
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
GetTickCount() won't work for servers which have a very long uptime. You could also use QueryPerformanceCounter, which normally has a much bigger time range.
Don't try it, just do it!
|
|
|
|
|
Please can you tell me how you get the currrently selected date from this control? all I seem to be able to get is the current date.
thanks,
|
|
|
|
|
CDateTimeCtrl::GetTime(...) should return the selected date and time. Good luck!
|
|
|
|
|
cheers for your fast reply!
Andy,
|
|
|
|
|
By Scrolling half of the scroll i want the complete page scroll.
when the scrollbar is at the middle the page should display bottom.
|
|
|
|
|
Have a look on MSDN for the SCROLLINFO structure. This will enable you to set the min and max limits of the scroll bar and the thumb size. A combination of nPage and nMax will give you the desired result.
For example,
SCROLLINFO si;
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_PAGE|SIF_RANGE|SIF_POS;
si.nPage = 5;
si.nMin = 0;
si.nMax = 9;
si.nPos = 0;
SetScrollInfo(hHscroll,SB_CTL,&si,TRUE);
nMax will set the scrollbar to be able to move 10 spaces, but nPage takes up 5 of these spaces, meaning that the scrollbar is only able to scroll the remaining 5.
In your project you should set those values according to the data you want to display. You must also process the default scrollbar messages and check the values against your display data. make use of the min() and max().
|
|
|
|
|
Thanks i had tried your solution but it is doing reverse of my requirement. My requirement is with half scroll complete page should be scrolled.If you have any other alternative please suggest me. I had tried all combination of nMax and nPage but not able to get the desired output.
|
|
|
|
|
Hi guys,
i am new to this group. i m facing a very serious problem with my project.
the details of the project are
1) we basically need to develop a client which is kind of a messenger
service something like yahoo.
2) it is based upon Jabber Technology. though there are a lot of
clients already present on this technology we want to develop a client
which is for an embedded device and not primarily for a web browser.
this is the basic reason why we want the program to be written on ANSI
C.
3) the platform on which we have to work and run this program is Visual C
4) what we have done till now is done coding for a
1) Client to Server communication and
2) Server to Client communication
3) some coding for multithreading with 1 or 2 errors
5) what is required now is to develop from this a multi threading
program which will enable us to communicate from Client to Client
through a server. this is the most primary requirement
after which XMPP protocol needs to be added
i am stuck with the multithreading part and this being my first project i really dont know how to go about it. i m really short of time and have a deadline of end of this month to submit this project. i really forward to help from you guys for my problem. in case of any further details about the project i would be more than happy to let u all know.
i am sending the multithreading program which gives few errors wn i build it. if you can solve that n make it working that would be awesome but even a new multithreading program would serve the purpose.
i really hope that i would get some help from you guys soon.
awaiting reply from you all
Regards,
S.Arunesh
|
|
|
|
|
Please post specific questions
|
|
|
|
|
|
there were some mistakes in previous program regarding header files. i am posting it again
#include<sys types.h="">
#include <winsock2.h>
//#include <process.h>
#include<windows.h>
#include<stdlib.h>
#include<stdio.h>
#include <stddef.h>
#include <conio.h>
void CheckKey(void *);
void main()
{
int cont,create_socket,new_socket,addrlen;
int bufsize = 1024;
char *buffer =(char *) malloc(bufsize);
struct sockaddr_in address;
WSADATA wsaData;
if(WSAStartup(0x202,&wsaData) == SOCKET_ERROR)
{
return ;
}
//printf("\x1B[2J");
if ((create_socket = socket(AF_INET,SOCK_STREAM,0)) > 0)
printf("The socket was created\n");
address.sin_family = AF_INET;
address.sin_addr.s_addr = INADDR_ANY;
address.sin_port = htons(15000);
if (bind(create_socket,(struct sockaddr *)&address,sizeof(address)) == 0)
printf("Binding Socket\n");
int retval =listen(create_socket,SOMAXCONN);
addrlen = sizeof(struct sockaddr_in);
DWORD ThreadId;
HANDLE hWnd;
hWnd =CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)CheckKey,NULL,0,&ThreadId);
//CreateThread(CheckKey, 0, NULL );
new_socket = accept(create_socket,(struct sockaddr *)&address,&addrlen);
if (new_socket > 0){
recv(new_socket,buffer,bufsize,0);
printf("The Client %s is connected...\n",buffer);
//for(cont=1;cont<5000;cont++)
// printf("\x7");
}
do{
printf("Message to send: ");
gets(buffer);
send(new_socket,buffer,bufsize,0);
recv(new_socket,buffer,bufsize,0);
printf("Message recieved: %s\n",buffer);
}while(strcmp(buffer,"/q")); //user 'q' to quit
//close(new_socket);
//close(create_socket);
}
//void CheckKey()
//{
// new_socket = accept(create_socket,(struct sockaddr *)&address,&addrlen);
// if (new_socket > 0){
// printf("The Client %s is connected...\n",inet_ntoa(address.sin_addr));
//for(cont=1;cont<5000;cont++)
// printf("\x7");
// }
//}
/*void CheckKey(void * val)
{
while(1)
{
new_socket = accept(create_socket,(struct sockaddr *)&address,&addrlen);
if (new_socket > 0)
{
recv(new_socket,buffer,bufsize,0);
printf("The Client %s is connected...\n",buffer);
}
}
return ;
}*/
//DWORD WINAPI ValidateData(LPVOID Parameter)
//{
//Get the information about client entity
//SOCKET client = (SOCKET)Parameter;
//int rVal; //Return val
//char buf[11]; //used to send the validated data to client
//Get the data form client
//rVal = recv(client,buf,11,0);
//here we are performing simple check, the data came form client
//is valid or not
//at this point you can check your own data also, which needs some modification
//if(strcmp(buf,"Data On Socket"))
//{
//Send back the data to the client
//rVal = send(client,"YES",3,0);
//}
//else
//{
//Send back the data to the client
//rVal = send(client,"NO",2,0);
//}
//return 0;
//}
|
|
|
|
|
dont know why the header files go missing every time. i am sending them again. hopefully it gets posted this time
#include <sys types.h="">
#include <winsock2.h>
//#include <process.h>
#include<windows.h>
#include<stdlib.h>
#include<stdio.h>
#include <stddef.h>
#include <conio.h>
|
|
|
|
|
when posting a message you should replace the < & > with HTML compatible versions. Under the text box, above the smilies there are Formatting tags to do this for you. Here you will also find the <pre> & </pre> tags for entering "readable" code.
|
|
|
|
|
Please, read this post[^] before posting. Use the pre and code tags.
seekin_nirvana wrote: there are no errors while compilation but while building 2 errors crop up
What do you mean by building ? Are you talking about linking errors ? If yes, post the exact error message.
seekin_nirvana wrote: so it would be really great if any1 could do that
Nobody here will do the job for you. People are here to help each other, not to work for the others.
|
|
|
|
|
sorry dude if u felt i was too demanding regarding help. its just that my situation is soo bad. thats y........ anyways any kind of help frm you would be really valuable to me
here is the exact problem obtained while linking. hope you would be able to resolve it.
Linking...
multithread.obj : error LNK2001: unresolved external symbol "void __cdecl CheckKey(void *)" (?CheckKey@@YAXPAX@Z)
Debug/multithread.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
multithread.exe - 2 error(s), 0 warning(s)
|
|
|
|
|
You have a declaration of your CheckKey function but there is on definition (they are all commented out). So, that's why you don't have an error at compile time (the compiler suppose the function is defined somewhere because you have declared it) but the linker is unable to find the definition, thus throws an unresolved symbol. Provide a definition to the function and this will solve your problem.
|
|
|
|
|
Also, don't go around casting things to make the compiler shut up unless you know what you are doing. You've cast your CheckKey function which has a signature of void __cdecl (void *) to LPTHREAD_START_ROUTINE which is DWORD __stdcall (LPVOID lpThreadParameter). This is a recipe for stack corruption.
|
|
|
|
|
If you haven’t got experience with multithreaded programming and you're on a deadline then multithreaded is not an option. Writing multithreaded programs is hard, debugging badly written multithreaded programs is, at times, next to impossible. Don't paint yourself into a corner.
Steve
|
|
|
|
|
I have a dialog template which I use for 3 seperate functions
1. Display data (all edit fields set to read-only).
2. Edit data (enable edit controls, display data and process input).
3. New Data (enable edit controls, initially set to empty and process input).
Now lets say the user calls 'Display data' then decides they want to edit something. Well I have an edit button, but the callback does not process the edit fields. At the moment it closes the dialog and returns a value indicating users choice, the main loop then opens 'Edit data'.
It works but I'm sure it could work better. When the switch occurs the size and position is reset.
Now the callback function is simply a pointer, is it possible to change the callback pointer from the dialog when the user hits the edit button?
|
|
|
|
|
waldermort wrote: is it possible to change the callback pointer from the dialog
SetWindowLong()
I think you should reconsider your design and have one dialog procedure that handles all three cases depending on a flag. It is easier to change a flag then it is to switch dialog procedures.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|