|
Glad you got it working But you missed my point about keeping TCITEM structs in a list (or vector, doesn't matter). TCITEM::pszText is a pointer to a char array, and you're storing the pointer without storing what it points to as well. Later on if you try to read/write to a pszText pointer, it will be pointing into freed memory or other data, not the original string.
--Mike--
LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
I have a library consisting of lots of files. I have one single #include file which includes all the relevant header files, depending on the compile platform. However, I would like to shove all the classes that are declared in the library into one namespace, but don't want to have to go through every #include file and put namespace blah {} around the classes and then have to put blah:: in front of every blinking function. Is there a way of grouping a collection of classes and uploading them into a namespace?
|
|
|
|
|
Add a namespace around the includes:
namespace LibraryStuff
{
#include <libheader1.h>
#include <libheader2.h>
...
} You'd only do this in the code that's using the library, the library itself would remain unchanged.
--Mike--
LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
Hello, I'm very interesting by Paul Yi Tung, Ooi sujet : "Tracking an object from a live video input".
I would like learn the picture process ... But, I don't now where there are sources files !
Now, I have Visual Studio .NET 2005 ( Beta ... ) and I cant compile this source ... The compilated program ( .exe ) display at screen the pictures ( video ), but, when I select process mode, the MFC program shutdown ...
It's not funny !
Who can help me ?
I'm french ... Sorry, my english is realy bad !
|
|
|
|
|
I want to change the modified time of a file by giving year,month..etc as input.To use SetFileTime() we need ptr to FILETIME structure.I am able to change the modified time to the current time by taking the systemtime.But facing problem to change to other input time.Please help...Thanks.
|
|
|
|
|
Monisankar wrote:
I want to change the modified time of a file...I am able to change the modified time
So what is it that you are having troubles with? Perhaps a code snippet of what you are doing, and the results it is producing, is in order.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
SYSTEMTIME st;
ZeroMemory (&st, sizeof (st));
st.wYear = 1959;
st.wMonth = 1;
st.wDay = 31;
st.wHour = 5;
st.wMinute = 30;
FILETIME ft;
VERIFY (SystemTimeToFileTime (&st, &ft));
VERIFY (SetFileTime (hFile, NULL, NULL, &ft)); /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Dear members of CodeProject,
I want to invite the most experienced coders (C#, VC++, VB, VB.NET, ASP, ASP.NET and all the other technologies) to join the new outsourcing auction site. There is over 5 the most famous sites on the web now (like RentACoder.com, Elance.com, GetAFreelancer.com and other) but our site is absolutely outstanding because it have now and will have in future a lot of functions and features.
Now under the launch of our site we are looking for skilled, experienced and honest developers to join us. You will work directly with customers, NO agencies, NO third party providers. We need teams of developers or very experienced individuals with perfect English (and maybe German) skills.
If you are INDIVIDUAL you MUST have at least 2 years in outsourcing like freelancer (development, working with customers directly, knowledge about full cycle of development, keep in mind deadlines, etc.).
If you are TEAM or COMPANY you must have at least 3 years of experience and 5-15 developers (or designers, or other personal depending on skills) inside of your group.
All the questions and suggestions you may send at rec@modelstyle.com,
Good luck!
|
|
|
|
|
PavelMenshikov wrote:
the most famous sites on the web now (like RentACoder.com,
I think many CPians would characterize RentACoder as infamous, not famous.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I hate those freelance sites....for me it's almost impossible to compete with some of the prices and quotes...
Especially the PHP freelance web sites
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
PavelMenshikov wrote:
rec@modelstyle.com,
ModelStyle look like to Be Model Agency not Programmer Agency .
anywya this is not right forum to post advetisement,you better try posting it in Lounge.
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Help,help ,help
Can anybody pls tell me what is back pointers
and when are they used?
|
|
|
|
|
back pointers are used to reference the owner of an object.
lets say you have an object that contains related objects ( for example, a car contains wheels ); the car class knows that it holds X number of wheels; but by default, the wheels don't know they are contained by the car; they could be contained by a bus or a truck; by adding a back pointer to the wheel class, you can know that the class that contain the wheel is indeed a car or a bus or a truck.
/// really pseudo code ...
class wheel;
class car : public vehicule
{
wheel* m_pWheel1;
wheel* m_pWheel2;
wheel* m_pWheel3;
wheel* m_pWheel4;
};
class wheel
{
wheel ( vehicule* pVehicule ){m_pVehicule=pVehicule};
vehicule* m_pVehicule;
};
...
car::car()
{
m_pWheel1 = new wheel( this; );
m_pWheel2 = new wheel( this; );
m_pWheel3 = new wheel( this; );
m_pWheel4 = new wheel( this; );
}
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Thanks very much for solving my problem
Now i know whom to approach
when i got a problem
Thanks once more
|
|
|
|
|
Hey all,
I'm trying to figure out how to directly write to a device in Windows. Basically, what I'm wanting to do is create an image of a device (specifically, a CompactFlash card that doesn't use a filesystem Windows recognises), store it as a file, modify it and dump it back to the card.
Currently, in version 0.001 of my program, I'm just calling dd for Windows using ShellExecute - this works perfectly, but obviously this isn't exactly acceptable for the final product! (and in the kludgy way I've done it, it locks the whole program and I can't implement a progress bar etc etc)
I'm HOPING it's as easy as using fopen and just treating it like a file from then on (sorry, that's my Unix background speaking)...
Any help would be much appreciated.
|
|
|
|
|
How can i stop and notify new device which isn't installed?
I have been programing following but it doesn't work...
Can somebody tell me how...please
following is my code:
==========================================================
BOOL CSPClientDlg::ConnexantStartStop(DWORD NewState)
{
// scan only Media-Classes
HDEVINFO hDevInfo = SetupDiGetClassDevs((LPGUID)&GUID_DEVCLASS_MEDIA, NULL,
NULL, DIGCF_PRESENT);
if (hDevInfo == INVALID_HANDLE_VALUE){
return FALSE;
}
SP_DEVINFO_DATA DeviceInfoData = {sizeof(SP_DEVINFO_DATA)};
DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
BOOL bFound = FALSE;
for(int i=0; SetupDiEnumDeviceInfo(hDevInfo, i, &DeviceInfoData); i++){
DWORD DataT;
LPTSTR buffer = NULL;
DWORD buffersize = 0;
while (!SetupDiGetDeviceRegistryProperty(hDevInfo, &DeviceInfoData,SPDRP_DEVICEDESC,
&DataT, (PBYTE)buffer, buffersize, &buffersize)){
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER){
if (buffer){
LocalFree(buffer);
}
buffer = (LPTSTR)LocalAlloc(LPTR, buffersize);
}else{
return FALSE;
}
}
if(strcmp(buffer,"USB") == 0){
bFound = TRUE;
}
if(buffer){
LocalFree(buffer);
}
if(bFound == TRUE){
break;
}
}
if(bFound == TRUE){
// it can take some time...
CWaitCursor wait;
SP_PROPCHANGE_PARAMS PropChangeParams = {sizeof(SP_CLASSINSTALL_HEADER)};
PropChangeParams.ClassInstallHeader.cbSize =
sizeof(SP_CLASSINSTALL_HEADER);
PropChangeParams.ClassInstallHeader.InstallFunction = DIF_PROPERTYCHANGE;
PropChangeParams.Scope = DICS_FLAG_GLOBAL;
PropChangeParams.StateChange = NewState;
PropChangeParams.HwProfile = 0;
if (!SetupDiSetClassInstallParams(hDevInfo,&DeviceInfoData,
(SP_CLASSINSTALL_HEADER *)&PropChangeParams,sizeof(PropChangeParams))){
return FALSE;
}
if(!SetupDiChangeState(hDevInfo,&DeviceInfoData)){
return FALSE;
}
PropChangeParams.ClassInstallHeader.cbSize =sizeof(SP_CLASSINSTALL_HEADER);
PropChangeParams.ClassInstallHeader.InstallFunction = DIF_PROPERTYCHANGE;
PropChangeParams.Scope = DICS_FLAG_CONFIGSPECIFIC;
PropChangeParams.StateChange = NewState;
PropChangeParams.HwProfile = 0;
if (!SetupDiSetClassInstallParams(hDevInfo,&DeviceInfoData,
(SP_CLASSINSTALL_HEADER *)&PropChangeParams,sizeof(PropChangeParams))
||!SetupDiCallClassInstaller(DIF_PROPERTYCHANGE,hDevInfo,&DeviceInfoData)){
return FALSE;
}
if(!SetupDiChangeState(hDevInfo,&DeviceInfoData)){
return FALSE;
}
}
SetupDiDestroyDeviceInfoList(hDevInfo);
return bFound;
}
=====================================================
in this code, i want to stop only USBs...
Can someone help me to resolve this problem.thank you
Atsuki
|
|
|
|
|
hi !
I have a program written with MFC. I want it to retrieve some data from a mysql database that i have on my webserver. Can anyone tell me how to do this?
thanks
kane
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
http://www.coderkane.com
|
|
|
|
|
Have you looked into accessing it via ODBC using a CRecordset object?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
There is also MySQL++, the C++ wrapper for the MySQL C API, which is what I am using in my current project.
I don't know squat about MFC, but it works great with Win32s so I don't see any reason why you couldn't use it.
link to manual and other resources
http://dev.mysql.com/doc/plusplus/en/4_Tutorial.html[^]
Dave
|
|
|
|
|
If you have the data on your webserver I'm assuming you have apache and php running yes? If so you can write a very simple script on the server in php to return the data you want. From your mfc program you can "call" the script using the POST method (very simple - there are many classes here on cp that show you how to do that)
hth
|
|
|
|
|
hi,
i was trying to create irregular shaped figures on the desktop,i was able to do that in winnt using
HWND hwnd = ::FindWindow("Progman","Program Manager");
HRGN hrgn = createrectrgn(10,10,100,100);
::setwindowrgn(hwnd,rgn,TRUE);
& it worked fine ,but in the case of win98 the setwindowrgn always returns 0,so i changed the setwindowrgn to a MFC call it returns success but no desired results are seen.
And after all now iam confused over Createrectrgn about what it returns.It is said that it returns the handle to the region ,but is it region on the desktop or current.
I am really lost and confused.
any suggestions will be really helpful.
thanx in advance
regards
udaykumar
|
|
|
|
|
You should be able to get at the desktop window by calling GetDesktopWindow() or CWnd::GetDesktopWindow() . This should work across all (non-embedded) versions of Windows.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi guys
Long time ago, I had a problem to manage keyboard in a CFormview and I solved using accelerators.
Now I have another one.
When I open a dialog from the CFormview (the old one with accelerators) of my SDI app, I don't know how to manage the keyboard inside it. OnKeyDown doesnt't works.
There is a way to perform the same or similar accelerator's solution?
There is a way to have accelerators for each dialog that I open?
How can I do this?
Thanks in forwarding.
Doc
|
|
|
|
|
|
How can the sub item editing be handled for a list created at runtime.
laiju
|
|
|
|
|