|
AnShUmAn_VCPP wrote: I told him to pass the values to gethostbyname and change it to get the IP Address. Just check my first post to this question
Perhaps you should check out that post. You suggested gethostname() , which I indicated was to get the name of the local machine only. See the difference?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
|
|
|
|
|
HI,
I have some value in string object like
CString str = "ABC"
I want to create an array with the name that is the value in the string object, in the current exapmle it is "ABC"
so it should be
CObArray ABC;
How can I do this? That define a name of an aray that is the value got from some where.
Thanks
Regards.
|
|
|
|
|
You can't.
The best solution would be to dynamically create the array and add it to a map using the name.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Thanks,
Would you like to give me a code snipt , that how can I create and add to a map
Thanks again
Regards.
|
|
|
|
|
Find out how to use the MFC CMap<> or the STL map<>.
Use the MFC CArray<> or the STL vector<>
Eventually you will do something akin to mymap.Add(string, new CArray<>());
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Like said by Joe, you can't. But there is surely another solution to your problem. Maybe if you explain us what you want to achieve exactly, we could find a solution.
|
|
|
|
|
Hi,
Is there a Tab change (Tab click) event in CPropertySheet. Pls let me know what it is.
Thank you
Mohan
|
|
|
|
|
This method will be called when a property page is activated...
CPropertyPage::OnSetActive()
Owner drawn
Jesus Loves
|
|
|
|
|
Owner drawn wrote: CPropertyPage::OnSetActive()
Thanks, but this didn't help me. My problem is i needed to a get a value(user selects) of one property page to another property page during runtime for validation purpose.
Could you give me a idea pls
-- modified at 0:52 Monday 20th February, 2006
|
|
|
|
|
|
I have an ActiveX control (.OCX) which will be used in normal HTML page. So far so good. But, I am not able to use this from within a .NET application. When that page is loaded, an error pops up telling there was an unsafe item and was blocked from running. The following is the exact error message. "This page provides potentially unsafe information to an ActiveX Control. Your current settings prohibit running controls in this manner. As a result, this page may not display correctly."
I have tried modifying all the security settings to low, manually in IE. Doesn't work still! How do I make it a safe control so that it wont display such a warning or it will not be blocked? Any help or pointers in this direction is highly appreciated.
Regards and thanks,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
-- modified at 0:12 Monday 20th February, 2006
|
|
|
|
|
|
That's so nice of you. Can you explain me how can I do this? Or direct me to an example somewhere? I am very new to COM and ActiveX stuff please bare with me if this is an extremely stupid question.
Thanks and Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
|
Hi All,
I need to implement this,
typedef struct
{
T1 m;
T2 m;
T3 m;
........
}XX;
XX a;
....
note T1,T2,T3... has no basic class, I hope
a function can auto visit the data member one by one like this
for(int pos=0; pos< size(pos);pos++)
//size function get struct data member number
{
.......
stmt.setParam(pos, getData(pos));
//getData function get struct data member by pos
.......
}
I only want to use struct please do no tell me use vector or list
thanks a lot
i hope some one can do it although it is not easy
-- modified at 23:37 Sunday 19th February, 2006
|
|
|
|
|
Unless all the members of the structure are the same type, it's extremely difficult. At runtime, the structure is just a single block of memory; the compiler sorts out which offsets into the memory to use at compile time. If your members are all the same type, you can calculate the address of each member like this (assuming they're int s):
address = struct_addr + (pos * sizeof(int)); where struct_addr is a pointer to the structure and pos is the index of the structure member.
Why don't you want to use a vector or list? You're trying to store an array of data, so why not use an array?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Even that calculation won't work if the packing size was, say 8 bytes. What he's asking for can't be done in a nice implementation-independent way.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Ugh. Yes, of course. Thanks for reminding me.
Although if the types are all the same, and you assume the packing is the same between each member it can be done similarly:
address = struct_address + (pos * sizeof(struct_name) / member_count); It still isn't a good idea though.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I got a C++/CLI answer
why c++ did not add this function when designing
using namespace System;
using namespace System::Reflection;
public ref struct Record
{
String ^ name;
int age;
};
int main(array<system::string ^=""> ^args)
{
Record ^ rec = gcnew Record;
rec->name = "George Washington";
rec->age = 274;
array<fieldinfo ^=""> ^ fieldInfo;
Type ^ recordType = Record::typeid;
fieldInfo = recordType->GetFields(
static_cast<bindingflags>(
BindingFlags::Public | BindingFlags::Instance));
for (int i = 0; i < fieldInfo->Length; ++i)
{
Console::WriteLine("{0} = {1}",
fieldInfo[i]->Name,
fieldInfo[i]->GetValue(rec));
}
return 0;
}
|
|
|
|
|
That's not a C++ function - you're using the features of the .NET class library. It won't work anywhere but under .NET.
I still maintain that it's a bad idea - you're using a structure like an array, so why not just use an array?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
How to create a custom control at runtime?
Thanks.
|
|
|
|
|
Call the control's Create() member function.
You may be right
I may be crazy
But it just may be a lunatic you’re looking for
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Hi guys,
I have written a simple VC++ program, it works perfectly ok when i excute it with ctrl+F5. but when i set a break point and start excuting it in Debug mode i get the following errors msgs.
Loaded 'C:\WINNT\system32\ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\KERNEL32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\system32\EntAPI.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\ADVAPI32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\psapi.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\NETAPI32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\system32\dnsapi.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\wsock32.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\ws2_32.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\ws2help.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\netrap.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\ntdsapi.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\WLDAP32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\system32\secur32.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\samlib.dll', no matching symbolic information found.
The program 'C:\TMP\VCplus\Debug\VCplus.exe' has exited with code 0 (0x0).
Can any one of you guys help mee.....
Thank you guys.....
Tuscon.....
|
|
|
|
|
Those are not errors. Those messages are just telling you that the dlls were loaded by your program, and that they do not contain any debugging information so the debugger will not be able to step into any code in those dlls.
You may be right
I may be crazy
But it just may be a lunatic you’re looking for
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Thank You very much...
Thank you guys.....
Tuscon.....
|
|
|
|