|
Salvador Dali wrote:
Umm...can you be a little bit more specific on how one would go about using this?
SysListView32 is the system list view control class. You create it just like you would any other...using CreateWindow() . See here for an example.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
The objects to store contains a regular integer and a pointer. Each integer value is unique and received in a sequential order (the value is increased by one or more for each time).
- I want to find an object with a particular integer value as fast as possible.
- I don’t know the number of objects at load time, so I cant load all at once and use binary search.
I believe using a tree structure is not the most clever idea, since the data is in order from start.
Maybe a skip list is the best idea?.
|
|
|
|
|
How about some associative data structure, like a hash table or a map? You'd get constant lookup time (average) instead of the log n lookup time you'll get with a tree.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Store where?
It seems to me that if the integer ALWAYS increases by exactly one each time, you can use binary search. Just keep redcuing the index into the list by one-half until you home in on the value. I would htink this shoudl work because our data is of constant size and you know the index value is always increasing.
|
|
|
|
|
How can i communicate my pc with mobile i am using f-Bus
how can i know my terminal ID and phone device id i am using Nokia 3315 wht will be the device id of it how to determine it if any know pls help me
thanks
regards
sundar
|
|
|
|
|
mpsundar wrote:
how can i know my terminal ID and phone device id i am using Nokia 3315 wht will be the device id of it how to determine it if any know pls help me
Have you got any software to connect to nokia phone or you have to create your Own!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I want to know the public IP of a machine which is on LAN and connected to internet through LAN.
It's easy to get private ip.
I want to do this using C/C++/VC++.
What API or functions or line of codes i have to use?
Rakesh
|
|
|
|
|
You need a server that tells you the ip.
Don't try it, just do it!
|
|
|
|
|
There are a couple sites out there that will return your public ip when queried.
e.g.
http://checkip.dyndns.org/[^]
So you send them a get and parse the return.
As i said there are other sites that you may not have to parse, or that use a protocol other than http ... i don't remember any of them off-hand though, check google.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
thakns for response.
I want to do it using my application.
Is there any API or any function which will tell me about my public ip..
|
|
|
|
|
>> Is there any API or any function which will tell me about my public ip.
No.
Think about a typical home setup.
[Your PC] - [DHCP][Cable Modem] - [ISP] - ...
Your PC knows what IP the cable modem DHCP server has assigned it.
It can even find out what the cable modem IP is with respect to your PC.
But, the cable modem has 2 IP's, one on your internal network, and one assigned to it by the ISP.
You would have to query the cable modem (router) to find what IP it has on the ISP side.
This is possible, but generally too much work compared to a quick send/recv to a well-known server.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hello people,
I'd like to know how to declare and use an array of pointer on functions?
Lets say:
<br />
void f1() { ... }<br />
void f2() { ... }<br />
void f3() { ... }<br />
<br />
typedef struct _toto<br />
{<br />
int x, y;<br />
} TOTO;<br />
<br />
TOTO g_toto;<br />
<br />
void InitTOTO()<br />
{<br />
g_toto.x=g_toto.y=0;<br />
<br />
g_toto.functions[0]=f1;<br />
g_toto.functions[1]=f2;<br />
g_toto.functions[3]=f3; <br />
}<br />
<br />
int main()<br />
{<br />
InitTOTO();<br />
for (int i=0; i<3; i++)<br />
}<br />
I hope you see what I wish to do...
Thanks for giving me the clue
Best regards.
Fred.
There is no spoon.
|
|
|
|
|
The functions need to have the same prototype (that is, same return type, same number of arguments of same types).
Then you will need to typedef your prototype (just an example here):
typedef (int)MyFuncPrototype(int, int)
Then you can use your function pointer:
MyFuncPrototype FuncTable[3];<br />
FuncTable[0] = SomeFunction;<br />
....<br />
....<br />
FuncTable[0](5,6);
|
|
|
|
|
one idea is to use a function with a pointer to a class holding you parameters.
typedef (int)MyFuncPrototype(pParamObject)
|
|
|
|
|
See if this thread is of any help.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
in my application, i use some dialogs to update some of the data. I want to add some accelerators. I can add this accelerators in other parts of the application, they work but in dialogs i've a problem. for example when i use Ctrl+A i just got a "beep", it doesn't even "OnEditSelectAll" use this function. How can i use accelerators with Dialogs.
|
|
|
|
|
You can make a dialog use an accelerator resource (say IDR_DLG_ACCELERARATOR) doing the following:
Add the following members to your dialog class:
class CSomeDialog : public CDialog
{
private:
HACCEL m_hAccelTable;
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
};
Add the following to the dialog constructor
CSomeDialog::CSomeDialog()
{
m_hAccelTable = LoadAccelerators(
AfxGetResourceHandle(),
MAKEINTRESOURCE(IDR_DLG_ACCELERARATOR));
}
Then add the following function implementation:
BOOL CSomeDialog::PreTranslateMessage(MSG* pMsg)
{
if (m_hAccelTable && ::TranslateAccelerator(m_hWnd, m_hAccelTable, pMsg))
return TRUE;
return CDialog::PreTranslateMessage(pMsg);
}
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thank you Jose. it worked. A very pratical solution.
|
|
|
|
|
I have a file (d://*.txt)
require :
1.My app(exe) can read ,write ,delete ,update this file;
2.user(you or me) can't write ,update ,delete this file,but he can read this file.
can you give me advise please?
thanks
|
|
|
|
|
Open the file in read-only mode, and keep it open. That way no one can write to, or delete the file.
When you need to write to it, or update it or delete it, close the file handle, then do whatever you want with it.
Have fun.
this is this.
|
|
|
|
|
won't work anymore when closing the application
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Can use a service for that instead of a program.
this is this.
|
|
|
|
|
not a good method.
there's no need to use memory and processor ressources...
NTFS provides rights on the file system, which allow you to set who can and who cannot access the file/directory, and how wide is the authorization for one on that file...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I don't know if it is possible to set access rights for individual programs in NTFS ("not different users"). Like: one program can read modify/delete a file while another cannot?
Maybe you can link to the right source.
this is this.
|
|
|
|
|
To expand on toxcct's suggestion. Deny all access to the file except for one user (a user that is not used by any person). Then in your program, impersonate that user before trying to update the file. See CreateProcessWithLogonW() . Make sense?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|