|
Hi there,
Is anyone knows how to determine installed browsers and java engines versions using Visual C++ ?
Best regards, Kiril Kostov
|
|
|
|
|
Call me stupid, but how do you Navigate to html stored in RAM, rather than a file or URL? Am I going to have to create a temporary cache file first?
|
|
|
|
|
|
You can use resources like this.
res://module_name/ resources_name
good luck,
Dror
|
|
|
|
|
Hello, Everybody
I just used paintlib and jpeglib to save my screen capture as a JPEG file. In some application it works but in some it does not work. Don't know why. If you know any source code to do the screen capture and save it as JPEG, please give me an direction. Thank you very much.
|
|
|
|
|
this code will capture the screen and put it in a HBITMAP, you just then have to save it to a file
CDC dcScreen;
CDC dcMem;
CRect rc (m_lLeft,m_lTop,m_lRight,m_lBottom); // set this to be screen coords of window you want to grab
dcScreen.CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
// create a memory DC compatible to screen DC
dcMem.CreateCompatibleDC(&dcScreen);
// create a bitmap compatible with the screen DC
HBITMAP hbmp = ::CreateCompatibleBitmap(dcScreen.m_hDC, rc.Width(),rc.Height());
// select new bitmap into memory DC
HBITMAP bmpOld = (HBITMAP)::SelectObject(dcMem.m_hDC,hbmp);
// bitblt screen DC to memory DC
dcMem.BitBlt(0, 0, rc.Width(),rc.Height(),&dcScreen, rc.left, rc.top,SRCCOPY);
// get screen image
hbmp = (HBITMAP)::SelectObject(dcMem.m_hDC,bmpOld);
|
|
|
|
|
I need to save struct to file as text file(not binary)
How can I do it.
Please detail if you can.
Thanks
|
|
|
|
|
Assuming your struct has integers, use CString::Format() to make a string representation of the numbers, and write that string to the file.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
#define ID 10
#define NAME 26
typedef struct person{
char id[ID];
char name[NAME];
}person;
typedef person* p_person;
|
|
|
|
|
|
I want that in my file will be write:
________
id
name
time
________
but I dont success.
This is my code:
____________
str = "\n"; //not work !
file.SeekToEnd()
file.Write(p->id, sizeof(char)*ID);
file.Write(str, str.GetLength());
file.Write(p->name,sizeof(char)*NAME);
file.Write(str, str.GetLength());
file.Write(str_time, str_time.GetLength());
|
|
|
|
|
Does anyone know the functions windows calls to do an addnetwork connection. I do not want to assign it to a drive though, but rather treat it as a webfolder.
Thanks for any help
qVL
qluu@limitless.ca
|
|
|
|
|
Is there any method that convert a CTime in seconds? Thanks
|
|
|
|
|
Hi there,
You should look at CTimeSpan. (CTime - CTimeSpan = CTime...)
CTimeSpan has a function called GetTotalSeconds(),
example:
CTimeSpan myDiff(0,1,0,0); // 0 Days, 1 Hour, 0 Min, 0 Sec
ASSERT (myDiff.GetTotalSeconds()==3600);
hope this helps
Olli
|
|
|
|
|
Hello,
I have a program written in Visual C++ and I want to add some codes that can help me know
this program is being debigged (ex: in debug mode in Visual C++ ) in run-time.
Does anybody know how to do that ?
|
|
|
|
|
there is _DEBUG macro if your project's active configuration [Build->Set Active Configuration]is derived from Debug.
So you can check like this
#ifdef _DEBUG
//Run this code if in debug mode
#else
//Run this code if not in debug mode
#endif
|
|
|
|
|
|
There's a function you can call. I forget the name but it's something like IsDebuggerEnabled().
|
|
|
|
|
I get crappy things when I try and return a CString. It goes a little like this...
CString lotsofcrap;
blah blah
return lotsofcrap;
ERROR Unhandled exception...yadda yaddda
CString::CString(const CString& stringSrc)
{
ASSERT(stringSrc.GetData()->nRefs != 0); //**** DEBUGGER GOES TO THIS LINE
if (stringSrc.GetData()->nRefs >= 0)
{
ASSERT(stringSrc.GetData() != _afxDataNil);
m_pchData = stringSrc.m_pchData;
InterlockedIncrement(&GetData()->nRefs);
}
else
{
Init();
*this = stringSrc.m_pchData;
}
}
------------------------------------------------------
Why do it now when you can put it off and do it tomorrow?
|
|
|
|
|
|
K....
CString CLUPort::BuildStartCommand()
{
LUMessage msg;
CString strConnect;
memset(&msg, 0, sizeof(LUMessage));
msg.start.cmd = START;
msg.start.crc16 = crc16_checksum((byte_t *)&msg, sizeof(msg.start) - 2);
msg.start.crc16 = TO_buint16(msg.start.crc16);
memcpy(&strConnect, &msg, sizeof(msg.start));
return strConnect;
}
|
|
|
|
|
It's the memcpy bit - you need to get a pointer to the buffer and store data there rather than over the string object itself. See GetBuffer (I think) - also don't forget you need to make sure the buffer is of the correct length.
> Andrew.
|
|
|
|
|
Ok a little bit of reading convinces me that's the correct way to do this. However I don't understand what the buffer length is/should be. MSDN describes it to be "The minimum size of the character buffer in characters. This value does not include space for a null terminator." Eh?? Does this mean I need to specify a number greater than the largest possible length of the string-to-be?
|
|
|
|
|
The problem is in the memcpy()
You can't asign the mem to a CString
cheers!!!
Carlos Antollini.
|
|
|
|
|
You have overwritten CString object with LUMessage struct contents. CString is a C++ class, you can't write to CStrings using memcpy.
I have no idea what are the members of LUMessage (crc16 suggests ints) - you should convert them to strings and concatenate them in strConnect.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|