|
Thank you so much. I really appreciate your answer.
|
|
|
|
|
Hello everyone, this is my first post here.
I have been fighting with a problem for quite some time now, and now i´m running out of time.
I have googled til i almost dropped dead
Well, to get to the point.
I have been designing a system for measuring times and speeds for use at Drag Racing competitions. im am doing it as my final year project (thesis) at my school, the Swedish Polytechnic in Finland.
Used tools:
Visual Studio 6 pro, Access 97.
VC++ / MFC, ADO.
I have designed a dialog, on this dialog i have a bunch of editboxes. The idea is that the users types a number in one of the boxes. This number is a id for a competitor. i want to fetch data about this competitor and fill the other editboxes with that data. For example the make, model and engine size of the car.
I already added the Microsoft ADO Datacontrol and hooked up a dbcombo to it. That works ok, i can scroll data with the Data control. But this is not the way i want users to enter data. The users have a paper which contains the "ladder" so they just need to enter the number of the lefthand conpetitor and then the righthand.
I tried experimenting with the find method of the Crecordset class, but that is not going very well, as visual studio wont give me the memberfunctions as i usually does.
I have coded a bit of databases in Delphi and i must say that it is much easier But i like C++ and have to stick to it because speed is very important in this case.
How do i accomplish the above?
Please somebody help me out, we are testing on saturday and i don´t want to think about what will happen if i´m not ready
Thanks in advance!
-- modified at 9:11 Wednesday 10th May, 2006
Please, pretty please respond someone
P.S Later in i need to save the contents of two double[8] arrays to another table. Is there a simle way to run pure sql?
|
|
|
|
|
How to get Activex controls Version? throught MFC
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
hi,
u have to set version for activex control.
just include file version and product version in Version folder in resources.
cheers
sangeet
-- modified at 1:36 Friday 12th May, 2006
|
|
|
|
|
How to get Activex controls Version? i am using on my
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
Hi,
Can anyone supply sample code that can get/set the state of the
"Hide extensions for known file types" check box, which is in control panel "Folder Options".
Many thanks.
|
|
|
|
|
Check out HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced in the registry.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Thanks David your advice was very helpful. Although it hasn't entirely solved my problem, which is in code similar to this.
<br />
CFileDialog D;<br />
<br />
if( D.DoModal() == IDOK )<br />
{<br />
CString strFPN = D.GetFileName();<br />
CString strExt = D.GetFileExt();<br />
<br />
CString strFPNandExt = strFPN + strExt;<br />
<br />
}<br />
My problem is that when explorer is hiding file extensions, CFileDialog::GetFileExt() returns a null string.
So what I really need to know is whether there is a way to get the file extension of a file that is selected in CFileDialog, (or maybe anywhere in the shell) when file extensions are hidden.
I don't really want to have a registry value changed and then restored
when CFileDialog::DoModal() has finished its business.
|
|
|
|
|
Atom wrote: So what I really need to know is whether there is a way to get the file extension of a file that is selected in CFileDialog, (or maybe anywhere in the shell) when file extensions are hidden.
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Superb, just what I need.
Many thanks.
|
|
|
|
|
Hey! I have a chip card reader and some tools with it. this is the reader >>> http://www.chipdrive.de/cgi-bin/edcstore.cgi?user_action=list&category=Produkt;02_L%F6sungen;04_SC%20Tools;05_Screenshots
4th picture is where i should be programming and editing script... i think the script is in pascal language but some friend say that it could be programmed ba C++ too. Well i don't know really nothing about this....... i got this in school and have to done this by friday.
what i have to do is to programme some program which would do something like: showing my grades...
its like that... when you put chip card in reader it should pop-up new window when i would enter code... and another window would open where i would see my grades.... i would really need that!!!! please someone help me!!!!!!!!!
this is reader >>> http://www.chipdrive.de/cgi-bin/edcstore.cgi?category=Produkt;03_Chipkartenleser&user_action=detail&catalogno=P208199
this is software >>> http://www.chipdrive.de/cgi-bin/edcstore.cgi?user_action=list&category=Download%3B03_Software (the last one)
and a chip card - 256kb EEPROM
I2C protokol
brane
|
|
|
|
|
I'm really a beginner of this program,visual c++, so I'm loooking for someone that could help me.
I have to draw a pixel on the screen and I have to find its coordinates because then I'll have to move this point using(maybe) a for loop.
Thanks...and sorry for my english
Baile79
|
|
|
|
|
baile79 wrote: I have to draw a pixel on the screen and I have to find its coordinates...
This is a bit unclear. In order to render the pixel on the device, you must know it's x,y values. There shouldn't be any need to find anything.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Solved: The issue had something to do with recursing the end process function. I changed how the recursion worked and everythings fine now!
I'm writing a program to remove certain spyware. To do this it needs to get a filename and path from a clsid, possibly end a process, delete the file, and delete the clsid. The problem is, if it ends a process then the clsid variable goes from storing a clsid (eg. {00000000-0000-0000-0000-000000000001}) to having odd characters like: ↑▼% (I hope those show up. It's a cross, an upside down triangle, and a %).
This *only* happens if the code kills a process. Here's the function that searches the registry after being passed a clsid:
int delClsId(char *clsid)<br />
{<br />
HKEY keyHandle,key2,key3;<br />
char rgValue[1024];<br />
char fnlRes [1024];<br />
DWORD size1;<br />
DWORD Type;<br />
<br />
cout << "Reading key " << clsid << endl;<br />
<br />
if (RegOpenKeyEx(HKEY_CLASSES_ROOT,_T("CLSID"),0,KEY_ALL_ACCESS, &keyHandle) == ERROR_SUCCESS)<br />
{<br />
size1=1023;<br />
RegOpenKeyEx(keyHandle,clsid,0,KEY_ALL_ACCESS, &key2);<br />
cout << "Opening InProcServer32 in key " << clsid << endl;<br />
if (RegOpenKeyEx(key2,_T("InProcServer32"),0,KEY_ALL_ACCESS, &key3) == ERROR_SUCCESS)<br />
{<br />
if (RegQueryValueEx(key3,_T(""),NULL,&Type,(LPBYTE)rgValue,&size1) == ERROR_SUCCESS)<br />
{<br />
sprintf_s(fnlRes,"InProcServer32 is: %s",rgValue);<br />
cout << fnlRes << endl;<br />
delFile(rgValue);<br />
cout << "CLSID is " << clsid << endl;<br />
}<br />
RegCloseKey(key3);<br />
}<br />
<br />
if (RegDeleteKey(key2,_T("InprocServer32")) == ERROR_SUCCESS){<br />
cout << "Removed InprocServer32 Key!" << endl;<br />
} else if (RegDeleteKey(key2,_T("InprocServer32")) == ERROR_FILE_NOT_FOUND){<br />
cout << "Couldn't locate InprocServer32 key." << endl;<br />
} else {<br />
cout << "Failed to Remove InprocServer32 Key" << endl;<br />
}<br />
RegCloseKey(key2);<br />
<br />
<br />
}<br />
else strcpy_s(fnlRes,"Couldn't access system information.");<br />
<br />
RegCloseKey(keyHandle);<br />
<br />
char delKey[45];<br />
sprintf_s(delKey, "CLSID\\%s", _T(clsid));<br />
cout << delKey << endl;<br />
int i = 1;<br />
<br />
do{<br />
i = delRegKey(HKEY_CLASSES_ROOT, delKey);<br />
} while (i == 1);<br />
<br />
return 0;<br />
}<br />
From the function for killing the process I've narrowed the problem down to something that happens in the "if" part of this if/else statement:
<br />
if(TerminateProcess(hProc,0))<br />
{<br />
CloseHandle(hSnapShotm);<br />
CloseHandle(hSnapShot);<br />
CloseHandle(hProc);<br />
FreeLibrary(hInstLib);<br />
return 0;<br />
}<br />
else<br />
{<br />
CloseHandle(hSnapShotm);<br />
CloseHandle(hSnapShot);<br />
CloseHandle(hProc);<br />
FreeLibrary(hInstLib);<br />
return 602;<br />
}<br />
If the process isn't running, or there's no process to kill then there's no problem. Also, I realize usually you'll find dll files here, but I wanted to test how all these things would work together and would love to understand what's going on. I'm pretty new to c++ but have a strong programming background and large working knowledge of the registry. Thanks!
-- modified at 1:02 Wednesday 10th May, 2006
|
|
|
|
|
I was trying to retrieve the body of a message using the code below but
It is always returning
MAPI-E-NOT-FOUND:
hr = m_pfldrInbox->OpenEntry(
m_pInbox[msgID].lpProps[0].Value.bin.cb,
(ENTRYID*)m_pInbox[msgID].lpProps[0].Value.bin.lpb,
NULL,
MAPI_MODIFY | MAPI_DEFERRED_ERRORS,
&ulObjType,
(LPUNKNOWN*)&lpMessage);
//MessageBox(0, L"Message Opened", L"", 0);
if (SUCCEEDED(hr))
{
SPropValue * rgMsgprops = NULL;
ULONG rgMsgTags[] = {1, PR_BODY};
ULONG cCount = 0;
// IStream* istream;
ULONG ulNumChars;
// hr = lpMessage->GetProps((LPSPropTagArray) rgMsgTags, MAPI_UNICODE,
&cCount, &rgMsgprops);
hr = HrGetOneProp(lpMessage,PR_BODY,&rgMsgprops);
if (hr == MAPI_E_NOT_ENOUGH_MEMORY)
{
MessageBox(0, L"Not enough memory", L"", 0);
hr = lpMessage->OpenProperty(
PR_BODY,
&IID_IStream,
STGM_READ,
NULL,
(LPUNKNOWN *) &lpStream);
do
{
lpStream->Read(
sBuffer,
255,
&ulNumChars);
// if (ulNumChars >0) printf("%.*s",ulNumChars,szBuf);
}
while (ulNumChars >= 255);
// printf("\n");
hr = S_OK;
}
else if (hr == MAPI_E_NOT_FOUND)
{
//This is not an error. Many messages do not have
bodies.
//printf("Message has no body!\n");
MessageBox(0, L"Message has no body", L"", 0);
hr = S_OK;
}
else
{
//MessageBox(0, "%d", rgMsgprops[0].Value.lpszA, 0);
int x = 0;
do
{
sBuffer[x] = rgMsgprops[0].Value.lpszW[x];
x++;
//MessageBox(0, (LPCWSTR)sBuffer, L"", 0);
//bufferlen = strlen(rgMsgprops[0].Value.lpszW);
}while (((int)rgMsgprops[0].Value.lpszW[x-1] != NULL) && (x <
255));
}
}
If you can tell what is the problem please help
-- modified at 13:58 Tuesday 9th May, 2006
|
|
|
|
|
msolh wrote: It is always returning
MAPI-E-NOT-FOUND:
What is the "it" that is returning this value?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
I mean hr value is always MAPI-E-NOT-FOUND
|
|
|
|
|
I understand that. You did not indicate which of OpenEntry() , HrGetOneProp() , or OpenProperty() was returning that value.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
It is the HrGetOneProp() that is always returning the property tag that I specified. I used the same fuction to retrieve the subject and sender information using PR_SUBJECT and PR_SENDER_NAME property tags and it works. It only fails to get the message body. That is when I use PR_BODY.
-- modified at 13:59 Tuesday 9th May, 2006
|
|
|
|
|
Does this or this help?
For the message that is failing, are you sure it has a body?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Yeah, I am sure that the message has a body.
|
|
|
|
|
I have created an application and i want to add help to this application. when i press F1, the help should be displayed. where should i add the text and how can i add it in vc++ application. can i type all the text in microsoft word and call it in vc++ application? please let me know the procedure to do this.
Thank You
|
|
|
|
|
You should probably check out the HTML Help Workshop from Microsoft. This would be the standard tool used between about 2000-2004. I'm not sure if .NET came out with something different so I apologize if this is not the standard tool used by the masses anymore. I still code native and use the HTML Help Workshop for my released products. For what it's worth...
HTML Help Workshop[^]
Have fun
|
|
|
|
|
I've not done help in a very long time, but I seem to recall the need for a .hpj file, a .hm file, and a .rtf file. The Help Compiler will compile these into a .hlp file.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
David,
i must agree that the Help Workshop documentation is not very clear when you don't know where to start for a .hlp file.
could you please point out some good tutorials/articles to create one's first compiled help file ?
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|