|
thebouge wrote: Is there another way to define this in the class so I can use the "=" operator to set the value in the SQL table...
Since this is C++, why not just use a string object?
thebouge wrote: ...can someone share the correct syntax for updating the record?
I already suggested strcpy() (or a variant thereof).
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
thebouge wrote: custatus.m_BlendStatus = "DNL";
Use strcpy() .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
I deleted the .res folder of a VC++6.0 project by mistake. Now the project can not be load. I have the all *.h, *.cpp and a .clw file left. How to recover the .res folder and the whole project? The VC++6.0 project is MFC doc/view project.
Thanks!
Dan
|
|
|
|
|
Get the res folder from your source control system or, failing that, your backup...
Oh, what, you don't use either of those? You're (ever so slightly) screwed. You can get the default toolbar bitmaps and menus and string tables and things by creating a new project of the same type, but the dialogs you designed, the new menu entries you added, the toolbar buttons you created? They're gone.
Sorry to sound callous - but that's the way it is.
[edit] I just had a thought. Open the executable (presuming you have one) in Visual Studio - you can get a view of the contained resources and retrieve them from there (might be able to drag drop them into your project?
But - get yourself some source control and a backup - it makes sense, really. And you can get source control for 0$ - I use both Subversion and Git (through TortoiseSVN and TortoiseGit).[/edit]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I guess the .rc file and resource.h would also be needed.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Ya - you could get blank ones of those from a blank project. I think the drag'n'drop of resources would fill in a reasonable amount after that, though.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Did you look in the Recycle bin?
|
|
|
|
|
I have been able to get this 3 to work.
Window1 and Window2 have 2 different handles to 2 different windows.
theApp.m_pThreads [0]=AfxBeginThread(Thread,Window1);
theApp.m_pThreads [1]=AfxBeginThread(Thread,Window2);
theApp.m_pThreads[0]->ResumeThread();
theApp.m_pThreads[1]->ResumeThread();
theApp.m_pThreads[0]->SuspendThread();
theApp.m_pThreads[1]->SuspendThread();
My problem is I don't want to create a thread for every window, How do I reuse the threads and change Window1 to Window3.
I have tried searching for it, being new I must have missed some articles. Would someone help me with this.
Thanks a million.
|
|
|
|
|
|
Thank you,
I will read on that. I guess i should find Thread pools on code project for samples and better explanation on it.
thanks a million.
|
|
|
|
|
if you can use Boost, there's a threadpool[^] extension which might help, too.
|
|
|
|
|
Simply. You can consider to pass a pointer to an object instead of Window1. The object that wraps window handle value, should be managable by your main thread.
class AClassName
{
public:
HWND hWindow;
};
AClassName* pACN new AClassName;
pACN->hWindow = Window1;
theApp.m_pThreads [0] = AfxBeginThread(Thread, pACN);
Then you can refer to pACN->hWindow in your thread function appropriately.
You may have to employ some synchronization technics, too.
|
|
|
|
|
You can use PostThreadMessage to pass in the window handle to the thread to switch from one window to another.
And never pass the window object from one thread to another. Always pass the window handle and attach it to a new window object using CWnd::FromHandle inside the thread. A window handle and its object is managed by MFC using a map which is valid only for the current thread.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
It seems that will be my best choice for now. I can't find any articles or demo's on a thread pool using vc++. All I have seen so far are in C#.
|
|
|
|
|
Hi all,
Is it ok if we write thousands of key-value entries into registry? How it will effect the performance of the system? Please suggest me..
(i know, this question is not related to this forum, but, i dont know where can i get exact information about this. i googled before posting the message to this forum, but, could not get proper information )
|
|
|
|
|
ramana.g wrote: Is it ok if we write thousands of key-value entries into registry? How it will effect the performance of the system? Please suggest me..
Probably not a good idea. Why not put them in a file, maybe (something like) a SQLite database or an XML file?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Registry size is limited (to 25% of the paged pool). this can be changed by the user, though it's not obvious to most people how to do it. so, it's probably much better if you just write your data to a file.
|
|
|
|
|
I think it depends on how often does an ordinary user access registry.
When it is used only during the application initialization it is relatively fast. Of course it has hardware constrains, but again, to the average user (word processing, e-mail etc.) with GB’s of RAM it should make little difference. My “ancient “ PC with circa 380 MB of RAM and 1 GHz processor struggles when I do key searches.
I know this is not what you are asking. I guess to get a real answer you need to write a test program to really find out how registry interact with running application.
Good luck.
Cheers Vaclav
|
|
|
|
|
I have a program that write to other process's memory, but some part of that memory is NOT writeable. Can anyone tell me how to write to that part of memory, without changing the actual physical file?
Thanks and regard !
|
|
|
|
|
How exactly are you writing to the other process' memory, and why? How are you accessing the memory? how are you getting its address?
If you need to write to some memory area, e.g. a buffer, then it shouldn't be protected, so you shouldn't have problems.
If you're trying to write to protected memory, well, in general, you can't.
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
Actually, this is what i'm doing:
First, I use CreateProcess(...) to execute an application.
Then WriteProcessMemory(...) to write to that process's memory.
But in fact, some part of that process's memory space is NOT writeable. So what I want is a mechanism to write to protected memory.
|
|
|
|
|
What are you trying to do in fact ? Ok, please don't answer something like "I want to write the memory of a process"... I would like to know the higher level reason why you are trying to do something like that (specially when you want to write somewhere you don't have access to).
|
|
|
|
|
It's not a project in fact
I just wonder why a debugger can access and change any memory location of any (may be not some critical ) process that it's debugging.
Then I study and find out the way to access other process's mem, but hooked up with some location that CAN'T be write (with my mechanism of course ).
But a debugger still can write to that location. So there must be a solution or an other mechanism to do that?
|
|
|
|
|
A debugger is effectively the same process as the program it's debugging (OK, this is a very big generalisation) so it can access the memory without any problems. However, in a debugger, e.g. Visual Studio, you'll find that you still get errors if you try to access protected memory, like memory in a completely different process.
Debuggers aren't doing anything special, it's just the way they interact with the program being debugged that makes it look like they are.
edit : Actually, I think a lot of these kinds of questions come down to low-level stuff like assembler and computer architecture not being taught any more. Knowing what goes on under the hood can help you understand things a lot better, and often help you write better code. I've even had someone (a graduate, believe it or not) ask me "When you call a function, how does it know where to return back to?".
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
You might be able to with some kernel level driver? However, if some part of the virtual memory space has been marked as read-only, that's controlled by the memory management unit of the processor, so good luck with changing that....
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|