|
Hi!
I've deployed my application using visual studio Deployment project. I've added an uninstaller using the batch file. This file contains:
%windir%\system32\msiexec /x {650ED5B7-1EDA-40F8-B8A9-614150FCE744} /qr
When I uninstall some folders and files are not uninstalled. These are all downloaded from Internet. What else has to be done to Uninstall with out leaving folder or files?
|
|
|
|
|
|
hello friends
I want to know that can I use one setWindowLong procedure for more than one window id?
I am having too many window Id so can I call one Procedure for all windows id?
And If yes then How can i differentiate in procedure?
Thanks & Regards
Yogesh
|
|
|
|
|
Your question is not very clear; what are you trying to achieve? You can differentiate between Windows by various parameters such as class or user defined type.
|
|
|
|
|
Hello
I am calling a window procedure on right click of an event and am having such around 15 types of event.
for every Right click Procedure i am using setWindowLong like this:
wpOrigPPProc1 = (WNDPROC) SetWindowLong(GetDlgItem(hwndDlg,IDC_LEFT1), GWL_WNDPROC, (LONG) PPSubclassProc1);
wpOrigPPProc2 = (WNDPROC) SetWindowLong(GetDlgItem(hwndDlg,IDC_LEFT2), GWL_WNDPROC, (LONG) PPSubclassProc2);
.
.
.
and so on.
I want to use only one windowProcedure.
Is this possible or every Windowid needs separate procedure?
regards
Yogesh
|
|
|
|
|
yogeshs wrote: I want to use only one windowProcedure. Is this possible or every Windowid needs separate procedure?
Without knowing what your code is trying to do it's impossible to say for sure. However as a generalisation this should work, assuming you are able to make the correct decisions in your code according to the type of window that generates the message or notification.
|
|
|
|
|
I want to get String as : "6.591E+02" from text file,and transfer it to float.My file have a form:
STT x y
1 6.591E+02 8.575E+02
2 7.350E+02 9.289E+02
3 7.234E+02 1.078E+03
4 6.844E+02 1.191E+03
5 5.951E+02 1.306E+03
6 4.125E+02 1.259E+03
my code as:
CString m_file;<br />
UINT nOpenFlags;<br />
nOpenFlags = CFile ::modeRead|CFile ::modeCreate;<br />
UpdateData(TRUE);<br />
CFileDialog dlg(TRUE,0,0,OFN_HIDEREADONLY | OFN_FILEMUSTEXIST,"All Files (*.txt)|*.txt||");<br />
if (dlg.DoModal()==IDCANCEL) return;<br />
m_file=dlg.GetPathName();<br />
<br />
int i,count,j;<br />
count =0;<br />
UINT nOpenFlags1;<br />
CStdioFile Inputfile;<br />
CFileException File;<br />
CString s;<br />
tamthoi="";<br />
nOpenFlags1=CFile ::modeRead;<br />
if(!Inputfile.Open(m_file,nOpenFlags1,&File))<br />
{<br />
File.ReportError();<br />
}<br />
while(Inputfile.ReadString(s))<br />
{<br />
count++;<br />
tamthoi+=s;<br />
}<br />
Inputfile.Close();<br />
count_line=count;<br />
if(!Inputfile.Open(m_file,nOpenFlags1,&File))<br />
{<br />
File.ReportError();<br />
}<br />
m_Listfile.ResetContent();<br />
for(i=0;i<count_line;i++)<br />
{<br />
Inputfile.ReadString(s);<br />
m_Listfile.AddString(s);<br />
}<br />
Inputfile.Close();<br />
CStringArray cx,cy;<br />
cx.SetSize(count_line);<br />
cy.SetSize(count_line);<br />
x= new float[count_line];<br />
y= new float [count_line];<br />
for (i=1;i<count_line;i++)<br />
{<br />
int c;<br />
char *kytux,*kytuy;<br />
c=tamthoi.Find(" ",21*(i-1)+9);<br />
cx[i]=tamthoi.Mid(c+1,9);<br />
cy[i]=tamthoi.Mid(c+6,9);<br />
sscanf(cx[i],"&c",&kytux);<br />
sscanf(cx[i],"&c",&kytuy);<br />
x[i]=atof(kytux);<br />
y[i]=atof(kytuy);<br />
}<br />
UpdateData(FALSE);
|
|
|
|
|
Please mention the exact problem that you're facing.
You could understand the problem better by putting a breakpoint and then single stepping through the code in the debugger.
|
|
|
|
|
My problem is when i want show a result at Editbox(only show a element of array) then it's errored,and Editbox don't show anything. I want to know be this code errored?:
for (i=1;i<count_line;i++)<br />
{<br />
int c;<br />
char *kytux,*kytuy;<br />
c=tamthoi.Find(" ",21*(i-1)+9);<br />
cx[i]=tamthoi.Mid(c+1,9);<br />
cy[i]=tamthoi.Mid(c+6,9);<br />
sscanf(cx[i],"&c",&kytux);<br />
sscanf(cx[i],"&c",&kytuy);<br />
x[i]=atof(kytux);<br />
y[i]=atof(kytuy);
|
|
|
|
|
camuoi288 wrote: sscanf(cx[i],"&c",&kytux);
Your format constant is incorrect (should be "%c" ), and you are trying to store the response into an uninitialised (and wrong type of) variable. If cx[i] already contains a single character then why are you using sscanf() ?
Also please use <pre></pre> tags around your code (and indentation) to make it readable, like this:
for (i=1; i > count_line; i++)
{
int c;
char *kytux,*kytuy;
c=tamthoi.Find(" ",21*(i-1)+9);
cx[i]=tamthoi.Mid(c+1,9);
cy[i]=tamthoi.Mid(c+6,9);
sscanf(cx[i],"&c",&kytux);
sscanf(cx[i],"&c",&kytuy);
x[i]=atof(kytux);
y[i]=atof(kytuy);
|
|
|
|
|
camuoi288 wrote: sscanf(cx[i],"&c",&kytux); sscanf(cx[i],"&c",&kytuy);
Seems strange to attempt to put cx[i] into both kytux and kytuy .
Why not try:
x[i] = atof(cx[i]);
y[i] = atof(cy[i]);
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Hi,
Is it possible to know that the choosen printer is a PDF printer? And this programmaticaly?
Thanks,
Claude
|
|
|
|
|
Hi All,
I am tring to figure out is it possible to get the proxy type using C/C++ code.
Lets say i have an IP and Port of a proxy server.
I use it in my code and now my code works using a proxy, so my IP needs to be hide to the world...
I can do some, easy, test to see if the proxy is working or not.
But the thing i realy want to know is what is the proxy type, SOCKS4/5, anonymous/ High anonymous/ Elite one... and so on.
Do you know if there is a way to get this information, re by header info, special value etc.
Thanks a lot for your help,
Ram.
|
|
|
|
|
Hi, I need some help combining these two blocks of if statements. Thanks.
if(segments_comp[head_comp]->panel->Left <= Food->Left)
{
if(segments_comp[head_comp]->panel->Top >= Food->Top){direction_comp =2;}
else{direction_comp=-1;}
}
else if(segments_comp[head_comp]->panel->Left >= Food->Left)
{
if(segments_comp[head_comp]->panel->Top >= Food->Top){direction_comp =2;}
else{direction_comp=1;}
}
if(segments_comp[head_comp]->panel->Top <= Food->Top)
{
if(segments_comp[head_comp]->panel->Left <= Food->Left){direction_comp =-1;}
else{direction_comp=-2;}
}
else if(segments_comp[head_comp]->panel->Top >= Food->Top)
{
if(segments_comp[head_comp]->panel->Left >= Food->Left){direction_comp =1;}
else{direction_comp=2;}
}
|
|
|
|
|
that code is pretty bad, you essentially overwrite direction_comp in the second set of if/else statements, therefore it doesn't matter what the first one does, so combining them is as easy as just keeping the second block
if(segments_comp[head_comp]->panel->Top <= Food->Top)
{
if(segments_comp[head_comp]->panel->Left <= Food->Left)
direction_comp =-1;
else
direction_comp=-2;
}
else
{
if(segments_comp[head_comp]->panel->Left >= Food->Left)
direction_comp =1;
else
direction_comp=2;
}
|
|
|
|
|
Thanks. That code works better.
|
|
|
|
|
Hi all,
i m using this
char buffer[250];
CString str=_T("Test");
strcpy_s(buffer, str);
and this error 'strcpy_s' : none of the 2 overloads could convert all the argument types
comes please help me to resolve this.
|
|
|
|
|
This is happening because you are compiling for Unicode (UNICODE and/or _UNICODE is defined).
If you check on this MSDN page: http://msdn.microsoft.com/en-us/library/td1esda9%28v=vs.80%29.aspx[^] you will see that there is no overload that takes (char *, wchar_t *) (which is what you are passing; the CString in Unicode builds is wchar_t). So you have to convert your char string to wchar_t, or convert your CString to char. Or, don't build for Unicode.
|
|
|
|
|
I compulsory need to build in Unicode mode,
please give any example to solve it with Unicode.
|
|
|
|
|
|
Use the unicode version of the function - wcscpy_s .
Or you could use _tcscpy_s which will work for both unicode and non-unicode builds.
You would also need to define buffer with wchar_t or TCHAR instead of char .
|
|
|
|
|
now its done. but now one more problem generate.
fun1(char * buf);
fun1(char * buf)
{
HRESULT result = _channel->WritePacket((unsigned char*)buf, strlen(buf));
return ( !FAILED(result));
}
wchar_t * wbuf;
_tcscpy_s(wbuf,str.GetLength(),str);
fun1(wBuf);
|
|
|
|
|
You said you want a unicode build.
And char does not support unicode.
Remember that char and wchar_t are different data types and you CANNOT typecast between them.
|
|
|
|
|
Le@rner wrote: fun1(wBuf);
Seems self explanatory. wBuf is a wchar_t but fun1() is expecting a char .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
there don't use str, use str.GetBuffer(0); or other function to change CString to const char *;
|
|
|
|