|
You don't need to Attach , once bitmap is created. So remove the line, it should work!
ARSALAN MALIK
|
|
|
|
|
Thank you for y answer, have tryed it without attach before but its not running.
Even i need this attach because its necessary to display in the CWND.
So i need some how a HBITMAP and then need to attach it.
Actually the code running well when i am loading bitmap. But not in the way i have done now. I really stuck!"!!!!!!!!!!!
|
|
|
|
|
Hi
have solved the problem
with
CreateDIBitmap
bye
|
|
|
|
|
Hello everybody
I have one question.I want to get some pictures with a webcam. I wrote my Software with Visual C++. It is a Dialog class (MFC). Itried it with capCreateCaptureWindow but it doesn't work.
I hope someone can help me
See you
Michael
|
|
|
|
|
Webcams usually provide some sort of web server, that you can download it from there and then you can display it (as jpeg probably)
But without further info, it's difficult to say how can you do it.
|
|
|
|
|
Hi,
I am new to VC++.
How do I resample(upsample/downsample) any wave file to a predefined value. Basically how do I change the attributes denoted by the WAVEFORMATEX structure, of an already existing file. (for example I have to convert any wav file into 8 khz 16 bit, PCM). The file will be an already existing one and not one to be recorded.
Thanx in advance.
|
|
|
|
|
It's just a matter of math skills. I'm sorry, but I suggest you first read some articles about that.
Don't try it, just do it!
|
|
|
|
|
Hi,
How can I reterive IPv6 address of system. Which API I can use for this.
Thanks for Reply
Regards
Alpha
|
|
|
|
|
Look at getaddrinfo()
in the addrinfo struct there is a sockaddr struct which can have either an ipv4 or ipv6 structure.
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 Williams (Little Britain)
|
|
|
|
|
Hi,
This is ok. But i want to know all adapters which are present in the system along with their IPv6 ip addresses.getaddrinfo is socket call. I have tried IP Helper function GetAdaptersAddresses but I don't know it's not returning me IPv6 address. I am getting all details of adapter but not IP address.
Thanks for reply
Regards
Alpha
|
|
|
|
|
hi i want to open an exe as a file in my application. in my dialog box app there is a button when i click on that it will open a exe as a file and search for suppose "t".
how can i open an exe as a file and how to replace a char or string in it.
swarup
|
|
|
|
|
I think you use the GetOpenFileName() to open the exe file
the you need an handle in order to open file using CreateFileA
<br />
HANDLE hFile=CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, NULL);<br />
at this point you should have an handle to your exe file, now we read it into memory using ReadFileA
<br />
DWORD BR=0;
char *tempbuff=(char*)calloc(dFileSize,sizeof(char));<br />
<br />
ReadFile(hFile, tempbuff, dFileSize, &BR, NULL);<br />
<br />
if( BR < dFileSize){<br />
}<br />
now we search the string you're looking for
<br />
char *p=NULL;<br />
p=strstr(tempbuff,"TEXT_TO_BE_SEARCHED");<br />
if( p==NULL)
else you've the first occurrence<br />
for writing you do the same using WriteFile,
bye
Paolo
|
|
|
|
|
After reading the tempbuff. the size of it is showing as 3. i want to read the whole file.
swarup
|
|
|
|
|
Hi,
I have some MFC projects which use the following libs:
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
Are these libs always necessary for using MFC? How can I know which libs to use and will I get errors compiling/linking when those deleted from the project?
Best regards,
Jens
|
|
|
|
|
They are ignored if not used, if there's a lib missin, you will get an linker error that there's some function missing.
hope that helps
|
|
|
|
|
HI there
how to create a dll and how to use it can anybody tell me. if i create a dll and dont use a def file does it export a dll.
DLL_API int fnDll(void)
{
return 42;
}
#ifdef DLL_EXPORTS
#define DLL_API __declspec(dllexport)
#else
#define DLL_API __declspec(dllimport)
#endif
and rest of the code.
if i dont use a def file i think i canot export that function. is that so.
swarup
|
|
|
|
|
declare the funcion you want to export as
<br />
extern "C" __declspec( dllexport) BOOL Function(char *buffer,char *tg);<br />
in your DLL project
In the Project that need the function do
declare in header file
<br />
extern "C" __declspec( dllimport ) BOOL Function(char *buffer,char *tg);<br />
<br />
HANDLE hDLL=LoadLibrary("dllname");<br />
if(hDLL == NULL)<br />
{<br />
}<br />
<br />
hope it helps
Paolo
|
|
|
|
|
hi there
can anybody give a sample or example in how to create a thread and what's it use and how to use it.
swarup
|
|
|
|
|
This[^] is a very good intro to multi-threaded programming.
I Dream of Absolute Zero
|
|
|
|
|
Does anyone know how can I remove the "Restart" and "Log off" options from the shutdown dialog box of the WindowsXP in VC++?
Thanks in advance!
|
|
|
|
|
Does anyone know how can I remove the "Restart" and "Log off" options from the shutdown dialog box of the WindowsXP?
Thanks in advance!
|
|
|
|
|
Hi All
does anyone know how to programatically delete ODBC datasources
or can anyone point me in the right direction ?
thanks
Si
|
|
|
|
|
Hi,
You have to delete some keys in the registry.
Look in the registry under [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\].
Delete the Key of your ODBC datasource and the value of your ODBC datasource [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources].
Then should it be removed!
Use CRegKey to delete the entries in the registry.
P-Rex
|
|
|
|
|
Hi,
You have to delete some keys in the registry.
Look in the registry under [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\].
Delete the Key of your ODBC datasource and the value of your ODBC datasource [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources].
Then should it be removed!
Use CRegKey to delete the entries in the registry.
P-Rex
|
|
|
|
|
Hi there,
How can one allow the program to effectively wait until all the data has been received.
I have used the HasOverlappedIOCompleted and GetOverlappedResult function so far. But data is still incomplete. Only when I use Sleep(50) then I get all the data at once.
Code used to far :
while (!HasOverlappedIOCompleted (&ovRead));
and,
GetOverlappedResult(m_hComm, &ovRead, &BytesRead, TRUE);
Are there any other ways to wait?
I am reading 50 bytes at 9600 baud.
Thanks
|
|
|
|