|
hi again jeff
the code we use is as follows:
void CMainFrame::OnUpdateSignOut(CCmdUI* pCmdUI)
{
CMyApp *pApp = (CMyApp*)AfxGetApp();
if (!pApp->bSignedIn)
pCmdUI->Enable(FALSE);
}
we use a app level variable for the signed in status ... true = signed in ... false not ... this code works in ours
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
I am using CFTPConnection to upload some text files to a FTP server. If the server ignores case in it's directory path then all works well when I use SetCurrentDirectory() and call PutFile() , but when the server is case sensitive then SetCurrentDirectory() fails and all the files are uploaded on the root. I have debugged trough the steps and the string that is being passed into SetCurrentDirectory() is the correct string (with the appropiate capital letters).
Has anyone seen this? Or am doing this all wrong and should use a different set of functions?
Also SetCurrentDirectory() also fails when there are periods(.) in a directory name.
Thanks in advance for the help.
***********************
Tony Fontenot
Recreational Solutions
tony@recsolutions.com
***********************
|
|
|
|
|
I'm frensh, so take no care about how i write this message....
I want to put in the windows spool a printable file. I know some API like GetJob, EnumPrinters and so on... but i don't know how to use those
So if some peaple knows, it will be pretty cool to give me a solution !
Thanks,
March'
And remember, I'm frensh... and my English level is not very high
See you later on the Web !
|
|
|
|
|
As you know, i'm looking for how to use EnumPrinters...
Well, i know now how to get all printers on the network !
I give you my solution !
So COOL ! No?!
<br />
DWORD dwNeeded = 0;<br />
DWORD dwReturned = 0, i, j, fin1, fin2;<br />
int bFlag;<br />
CString s;<br />
<br />
m_List.ResetContent();<br />
EnumPrinters(PRINTER_ENUM_REMOTE, NULL, 1, NULL, 0, &dwNeeded, &dwReturned);<br />
if (dwNeeded == 0) <br />
AfxMessageBox("Erreur 1 -> size serveur");<br />
else<br />
{<br />
<br />
ppi1 = (PRINTER_INFO_1 *)GlobalAlloc(GPTR, dwNeeded);<br />
if (!ppi1)<br />
AfxMessageBox("Erreur 2 -> alloc serveur");<br />
else<br />
{<br />
bFlag = EnumPrinters(PRINTER_ENUM_REMOTE, NULL, 1, (LPBYTE)ppi1, dwNeeded, &dwNeeded, &dwReturned);<br />
if (!bFlag)<br />
{<br />
AfxMessageBox("Erreur 3 -> info serveur");<br />
}<br />
else<br />
{<br />
fin1 = dwReturned;<br />
for ( i=0 ; i<fin1 ; i++ )<br />
{<br />
s.Format("Nom Serveur: %s", ppi1->pName);<br />
m_List.AddString(s);<br />
s.Format("Description Serveur: %s", ppi1->pDescription);<br />
m_List.AddString(s);<br />
s.Format("Comment Serveur: %s", ppi1->pComment);<br />
m_List.AddString(s);<br />
m_List.AddString("");<br />
bFlag = EnumPrinters(PRINTER_ENUM_NAME, ppi1->pName, 1, NULL, 0, &dwNeeded, &dwReturned);<br />
if (dwNeeded == 0 )<br />
{<br />
AfxMessageBox("Erreur 4 -> size printer");<br />
}<br />
else<br />
{<br />
ppi2 = (PRINTER_INFO_1 *)GlobalAlloc(GPTR, dwNeeded);<br />
if (!ppi2)<br />
AfxMessageBox("Erreur 5 -> alloc printer");<br />
else<br />
{<br />
bFlag = EnumPrinters(PRINTER_ENUM_NAME, ppi1->pName, 1, (LPBYTE)ppi2, dwNeeded, &dwNeeded, &dwReturned);<br />
if (!bFlag)<br />
{<br />
AfxMessageBox("Erreur 6 -> info printer");<br />
}<br />
else<br />
{<br />
fin2 = dwReturned;<br />
for ( j=0 ; j<fin2 ; j++ )<br />
{<br />
s.Format("Nom Printer: %s", (ppi2+j)->pName);<br />
m_List.AddString(s);<br />
s.Format("Description Printer: %s", (ppi2+j)->pDescription);<br />
m_List.AddString(s);<br />
s.Format("Comment Printer: %s", (ppi2+j)->pComment);<br />
m_List.AddString("");<br />
}<br />
}<br />
}<br />
}<br />
m_List.AddString("");<br />
m_List.AddString("");<br />
ppi1 = ppi1 + 1;<br />
}<br />
}<br />
}<br />
}<br />
Now, i want to use AddJob... So if somebody knows something...
You know what you have to do !
See you later on the web !
March'
|
|
|
|
|
I use this code in some IScriptControl :
function f
dim x
'...
x = ob.GetArray ' x is VT_ARRAY | VT_BSTR, ob is ok
msgbox x(0)
end function
The script returns error on calling ExecuteStatement with "f" as parameter. The cause seems to be x(i) . The same code runs ok in a VB project. What's wrong?
rechi
|
|
|
|
|
Hi there,
In first, i want to tell i have not problem in using of TransparentBlt !!!
But i got two results in my running in Win98 and Win NT (2000 and XP).
In Win NT, my program works fine ... without any problem
But in Win98, it is very very bad ...
I don't know what's problem ...
I just want to know, DO YOU HAD PROBLEM LIKE ME ? IN WIN98 ?
What is ur advice ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Instead of using TransparentBlt, use another technique called True Mask Method. The method is as follows,
Make a monochrome mask in which fill white to the portion where you want to hide the source bitmap. Then use BitBlt 3 times as follows:
//1. Invert and draw
BitBlt(dcDest, x, y, W, H, dcSource, x1, y1, SRCINVERT);
//2. AND with the mask
BitBlt(dcDest, x, y, W, H, dcMask, 0, 0, SRCAND);
//3. Invert again to view the final bitmap
BitBlt(dcDest, x, y, W, H, dcSource, x1, y1, SRCINVERT);
Best of luck,
Rejeesh
|
|
|
|
|
I answered this question for you once before (here). Did that answer not help you?
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Hi there,
Is there any function for copying all of a vector elements to another vector ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
try std::copy
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Thank you Chris !!!
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
std::vector<int> v1;
std::vector<int> v2;
...
v1=v2;
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
THAT's IT !!!
Thanks alooot Joaquín !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I was just wondering if anybody has worked with the CMonthCalControl. I can't seem to get the selected date back to my variables so I can deal with it in different fashions. I keep getting 12/30/1899 which seems to be an unitialized variable.
The funny thing is, I can set the date properly.
Anybody have any ideas?
I've tried it with both m_Calendar.GetCurSel() and by sending a message to the control with a SYSTEMTIME structure.
Thanks for the help,
Nick
|
|
|
|
|
I just happen to have this same problem too! I debugged down to the GetCurSel() and found that even THAT was passing an invalid value.
My cludge consisted of the following:
...<br />
SYSTEMTIME RefTime;<br />
m_CalRef.GetCurSel(&RefTime);<br />
COleDateTime dRef(RefTime);<br />
m_Calendar = dRef;<br />
...
I put this code in a method: CalendarPatch() and called it at the very end of DoDataExchange(). I think there may be some issues with date range of SYSTEMTIME (not as large as COleDateTime (?)), but it works in my application thus far. If anyone can offer an explanation about why the standard implementation fails, I'd appreciate it.
JennyP
|
|
|
|
|
Hi,
I am doing:
if( (stream = fopen( "C:\\myjunk.txt", "r+t" )) != NULL )
{
fseek(stream, 0, SEEK_END);
int nSize = ftell(stream);
fseek(stream, 0, SEEK_SET);
char* list = new char[nSize + 1];
numread = fread( list, nSize, 1, stream );
list[nSize]=0;
m_rich1.SetWindowText(list);
m_edit1.SetWindowText(list);
fclose( stream );
}
In both the richedit and the edit, after all the valid text, I get a line of garbage. What am I doing wrong? How can I fix this?
Thanks,
ns
|
|
|
|
|
My guess is it's not being 0 terminated. You should throw out C style file access and use iostreams instead.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
|
|
|
|
|
Thank you so much. I didnt know much about istream stuff. It works now!ns
|
|
|
|
|
No worries. I have a series of articles here on CP on all the ways iostreams can be extended - check it out sometime. You'll see why I say that they are far superior to C style file handling.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
|
|
|
|
|
I searched under your name and up popped a bunch of cool articles that I will be reading in in the next few days. None of the C# ones, I'm afraid, since I barely have a handle on C++. The STL will be really handy since I use them (nervously).
Thanks again,
ns
|
|
|
|
|
ns wrote:
numread = fread( list, nSize, 1, stream ); list[nSize]=0;
should that not be
numread = fread( list, nSize, 1, stream );<br />
list[numread]=0;
|
|
|
|
|
It was returning numread as 0, the way it is written:
numread = fread( list, nSize, 1, stream )
Changing it to
numread = fread( list, 1, nSize,stream )
and list[numread] =0;
whole o/p was garbage, not just extra line of garbage.
Puzzled, but worked around with istream..
Thanks,
ns
|
|
|
|
|
|
Nope. DIdnt like that either.....
Thanks for the suggestion though.
ns
|
|
|
|
|
Arg. Someone please help because this is driving my crazy!
I have several apps that when I compile them using the win32 release configuration they bomb immediately. I'm downloading SP5 now, and I'm wondering if that will fix it. I've seen this before, and so have other devlopers where I work, but they all fixed it by shipping debug code. Unfortuately, that is not acceptible for the product.
If I can't compile it as release, is there a way to use the debug version, but instead of having the ASSERTS() in the MFC stuff produce a message box, have it bomb or exit right away? (Which would make it acceptible)
Many thanks in advance!
PS. I know it's not my code because according to the stack, it hasn't even entered my code yet:
MFC42! 73ddb4ec()
KERNEL32! 77e7eb69()
|
|
|
|
|