|
I have posted a problem in www.codeguru.com, but no respond so far My friend told me www.codeproject.com are more active these days... try my luck here.
The problem is drawing a simple MFC circle, will post a different display if you view it locally vs one view it through remote desktop. I'm suspecting this is a remote desktop problem or MFC problem.... can someone confirm or let me know if I miss anything? (it's okay when view through VNC Viewer)
I can't find how to attach document here, so you could click to codeguru to view the description of the problem in more detail
http://www.codeguru.com/forum/showthread.php?t=350088[^]
To be etically correct, do respond using codeproject if you viewed the issue through this forum. Thanks...
|
|
|
|
|
That's really weird. What are t he color depths on the two setups ? ( local and remote )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Not sure if I understand what color depths really means. Anyway, both my local and remote desktop is set to 32 bit colors. I tried both (run the application in either machine, and use the other as remote desktop), the problem persist.
|
|
|
|
|
color depth is bits per pixel. If both are 32 bit, that's really, really strange.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
interesting.....
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Christian
How come your title is different. Are you responding to my post on "Remote Desktop Issue"? If yes, thanks... at least someone bother to test it out....especially a Microsoft MVP in C++.
It would be great if you could found any insight to this problem
Thanks!
|
|
|
|
|
I'll have a look, but what it means is that someone deleted their post.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
Im trying to find out how to convert a SYSTEMTIME to BSTR. Cant find out how to do that.
Hopefully some of you could help me out.
Best regards
Thomas
|
|
|
|
|
banski wrote:
Cant find out how to do that.
That is because there is no standard way of doing this because there are many different date/time formats. A good choice is to output the string in the format that is default for the user's locale.
John
|
|
|
|
|
Thanks,
But how can I do that in the smartest way. If you have time to show me an example to point me in the right direction would be appreciated.
Best regards
banski
|
|
|
|
|
|
Hi,
Yes Im using MFC.
Thomas
|
|
|
|
|
BSTR SYSTIMEToBSTR(SYSTEMTIME st)
{
CTime time(st);
CString str = time.Format("%c");
return str.AllocSysString();
}
John
|
|
|
|
|
Thanks,
This helped me out with my problem.
I missed the str.AllocSysString();
Best regards
Thomas
|
|
|
|
|
Can anybody tell me how to create tables. I am putting a sample using adox but i got verious error. And by using sql querry, nothing happens. Please Help
ADOX::CatalogClass *cat = new ADOX::CatalogClass();
String *strDataName = String::Concat(Application::StartupPath, "\\Data\\Blank.mdb");
String *strCreate(S"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=");
strCreate = String::Concat(strCreate, strDatabaseName, "; Jet OLEDB:Engine Type=5");
cat->Create(strCreate);
ADOX::Table *tbl;
tbl->Name = "CD";
tbl->Columns->Append( S"ID", ADOX::adInteger);
tbl->Columns->Append( S"Name", ADOX::adVarWChar);
tbl>Columns("ID").Attributes = ADOX::adKeyPrimary;
cat->Tables->Append (tbl);
|
|
|
|
|
plzz help.
how a can i write a program to copy function (as a whole) from one c++ file to another c++ file ,(appending to its end)
the inputs of the programe shoid be source file name,function name and destination file name.
|
|
|
|
|
You want to copy a function, at runtime ? As in, you want to add functionality to a compiled class ? Can't be done.
Or are you asking again a question that has been adequately answered before ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
did it in the following way and it worked.
but the problem is how to add the file header attached with the
function .this comes befeore the function
eg.
///////////////////////////////////////////////////////////////////////////////
//
// history=...........etc
///////////////////////////////////////////////////////////////////////////////
using namespace std;
void main()
{
CStdioFile csf("E:\\lastfunc\\ii.cpp",CFile::modeRead);
CStdioFile csg("e:\\cc.cpp",CFile::modeNoTruncate|CFile::modeCreate|CFile::modeWrite);
csg.SeekToEnd();
CString str;
while(csf.ReadString(str))
{
if (str.Find("SetupTls",0)>=0)
{
int i=0;
cout<<str.getbuffer(str.getlength());
csg.writestring(str+"\n");
do {
if(csf.readstring(str))
{
if(str.find("{")="">=0)
{
i++;
}
if(str.Find("}")>=0)
{
i--;
}
cout<<cout<<str.getbuffer(str.getlength())<<'\n';
csg.writestring(str+"\n");
}
} while(i="">0);
}
}
csf.Close();
csg.Close();
}
|
|
|
|
|
I have just learned how to properly do sockets. And as such am currently experimenting with them. I am doing a kind of chat room type program but it needs to interpret certain commands and perform actions.
I cant decide how I want to route the commands though, do I want to use a big messy if statement block or a for loop that loops through checking aginist a if statement or some kind of hashing.
I am checking the first letter of each command received useing a switch statement so I dont check aginist EVEREY command, just the ones that begin with that letter. But I want this to be a pretty fast server considering I want to assum high client load. So whats the fastest way to run through all the possible commands until one is found?
Thanks.
P.S. Im on FreeBSD5.1r and this code doesnt need to be portable, so if there is something platform specific you want to add, please do.
|
|
|
|
|
I am using ReadDirectoryChangeW API to monitor the folders. I am not able to rename or move or copy a folder which is DIRECTLY under ther target monitoring folder.
For example: i have given 'D:\NewDirectory' has to be monitoried.
I have some subfolders under this 'NewDirectory'.
when this api started monitoring 'NewDirectory', then i am not able to rename the sub folders or filename which is DIRECTLY under this folder.
I have used createfile to get the handle, and passed the handle to ReadDirectoryChangeW.
Please tell me whats may be the problem
|
|
|
|
|
Hi folks!
i need a little help about how to control the height and width of the console when my application(console) is started.
I mean when my simple c++ code(e.g Helo world) starts its execution in the console, the Console is resized to what ever dimension (height & width) i mentioned in my program; plz do tell me how to controll the dimension of my console...
Plz i need simple c++ code i.e. no MFC no Windows programming..
Regards, JinBaba.
Bye.
|
|
|
|
|
hi,
I'm student.But I can not much.I have to make a c++ programm to search and to return some values from a Textfile. The Textfile looks like:
proxy_name="musterman"
Proxy_pass="123123"
name="James Bond"
pass="123aa123"
the program must be written in c++. I have already done something, but it is to
so is it, what I wrote:
LoadConfigFile::ParseConfigFile(const std::String & obj){
std::string line;
std::String s="";
if (obj.length <= 0)
return false;
ifstream dat(obj.c_str());// Konfigurationsdatei
if (!dat){
cout<<"Die Datei konnte nicht geöffnet werden.";
return false;
}
getline(dat,line);
????????????????????
thank you for your help
|
|
|
|
|
Use getline to read a line at a time from the file. As you're using Managed C++, I'd recommend using regular expressions to parse the name/value pairs. Be aware, you're not writing C++ code, but a mixture of C++ and Microsoft specific .NET code.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
try using pcre library (perl compatible regular expressions); beware learning how to use it. is tricky
|
|
|
|
|
Hi, is there sample code to stop another mfc dialog application (.exe) from an mfc application ? THANKS !
|
|
|
|