|
hum, yes, i see the point.
but what if the new business schema doesn't know its previous versions design ?
how do you think such a migration tool could be done ?
BTW, this is just a guess, for my curiosity, because everything works fine now (even if bad designed) and i think that your latest suggestion is the way to go...
|
|
|
|
|
toxcct wrote: what if the new business schema doesn't know its previous versions design ?
Ouch. That's a serious problem, since you can't do a silent upgrade (or a separate migration) without full knowledge of the old and new schemas.
/ravi
|
|
|
|
|
Ravi Bhavnani wrote: since you can't do a silent upgrade (or a separate migration) without full knowledge of the old and new schemas
that's why i was importing both classes version.
well, thanks Ravi, that was helpful
|
|
|
|
|
Glad to be of assistance!
Btw, this[^] hack uses the serialization techniques described in my tutorial and is able to silently upgrade all previous 12 versions of its database without any intervention by the user.
/ravi
|
|
|
|
|
I'm including a CComboBox on the first CPropertyPage of a CPropertySheet displayed in wizard mode with the following styles for the property sheet PSH_WIZARD97|PSH_WATERMARK|PSH_HEADER .
The problem is that the drop down from the combo box is being drawn with the watermark bitmap as its background and I can't figure out how to stop it. Apart from anything else this makes it pretty hard to read the combo box text.
I realise this is probably something obvious but any help would be appreciated.
Thanks,
Ewan
|
|
|
|
|
in VS NET 2005 if you don't use the UNICODE libraries for your MFC application, then the edit control box (in form view or dialog) will be no longer flat. is anybody has any idea how to fix this?
cheers
|
|
|
|
|
I have a dialog class and another class that inherits from Cwnd. Call them class A and class B. They do not inherit from each other. However, i need for class B to have access to a member var in class A. Is the corect thing to do to have a pointer somewhere global to class A so that class B can use it when it needs it? If so, can someone help me with the syntax. I have tried different things and have been unsuccessful.
Thanks,
|
|
|
|
|
Please think about your design... otherwise, declare the classes "friend" as appropriate. For example, if you want to grant class A access to class B private areas, class B must state that class A is a friend.
Run-time - if you want access to the live data, well, you'd need to think about where you want the data and how the object instances know of the other.
Charlie Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.
My son's PDA is an M249 SAW.
My other son commutes in an M1A2 Abrams
|
|
|
|
|
What is the "physical" relationship between class A and B ?
can't you pass a pointer a A to class B ?
|
|
|
|
|
I can do that but i think that the compiler gets confused when i do a double include...
e.g.
Class A : public CDialog
#include B.h
SetDlgPtr(this);
Class B : public CWnd
#include A.h
void B::SetDlgPtr(CA * pCA)
{}
|
|
|
|
|
This is a common problem. The solution is simple. In one of the .h files, don't #include the header file of the other class. Instead just put a forward declaration. For example, in b.h, remove #include A.h and put "Class A;". Then in b.cpp put the #include a.h.
|
|
|
|
|
what about creating a static pointer in the classes that you want to be able to use from any other class/function. then all you need to do is include the header for the class and voila!. For example:
<br />
<br />
class One<br />
{<br />
public:<br />
One(void);<br />
~One(void);<br />
public:<br />
void oneFunction();<br />
int oneX;<br />
<br />
};<br />
<br />
class Two<br />
{<br />
public:<br />
Two(void);<br />
~Two(void);<br />
public:<br />
static Two* m_ptrTwo;
<br />
void twoFunction();<br />
int twoX;<br />
};<br />
<br />
and the body...
<br />
<br />
#include "hello.h"<br />
<br />
<br />
Two*Two::m_ptrTwo = NULL;
<br />
Two::Two(void)<br />
{<br />
m_ptrTwo = this;
}<br />
<br />
Now we can use the pointer 'm_ptrTwo' to call anything in the public interface of the class Two. For example:
<br />
One::oneFunction()<br />
{<br />
Two::m_ptrTwo->twoFunction();<br />
Two::m_ptrTwo->twoX = 1234;<br />
}<br />
<br />
|
|
|
|
|
I have seen some folks using HeapAlloc instead of malloc, how is that different?
thanks!
|
|
|
|
|
All my literature states they are basically the same. I guess portability would be the only difference. Malloc does not require a specific OS. HeapAlloc does.
But correct me if I'm wrong...
|
|
|
|
|
They are effectively the same. However malloc is in the C runtime libraries, so if you use it your application has to link in the C runtime. HeapAlloc is defined in kernel32.dll, so if you want to reduce the code size of your application you can avoid linking to the C runtime and use HeapAlloc to allocate memory.
Using HeapAlloc may make your code less portable if that is a concern for you.
I hope this helps.
Deus caritas est
|
|
|
|
|
Portability across different OSes or even across different flavours of Windows?
thanks!
|
|
|
|
|
Across different OSs.
Deus caritas est
|
|
|
|
|
Every process creates a default process heap.
This is the heap used by malloc/new/...
Aside from using the process heap, malloc/new/... (can) add other optimization features such as lookaside lists, small-block heaps, ...
HeapAlloc is the low level way to alloc a block of memory on a heap.
Some people will create a number of heaps within a program, each designed to hold a specific type of data or a specific group of data. This can help reduce heap fragmentation and speed up parts of some applications.
I use separate heaps for different types of data (e.g. all string buffers in one heap, all blobs in another, ...).
I use separate heaps for different groups of data (e.g. all database column data in one heap, all network packets in another, ...).
This just touches on the subject.
In the end it provides the developer with just another tool.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
I have tried so many times to create a new report using crystal report 11 by incorporating a template with vc++. I didnot find any article or sample code which is written in c++. But after some effort I got to know that there is a function called put_ReportTemplate() which is used for this task. I already know how to create a new report without using a template.
If anybody can help me by supplying a vc++ code, it will greatly appreciated.
Jagathucsc
|
|
|
|
|
hello.. i am using a listctrl box to display the directories on the FTP server.. the directory listing is successful when first connected to the server. but when refresh button is pressed, the directory listing fails. the refresh button uses the same code that is used for the directory listing. can anyone tell me what to do??
thanks..
vijay aroli
|
|
|
|
|
Can you post the refresh code ? Can you tell us what fails and how it looks like ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
hello sir!!i am new to MFC programming and i am developing an FTP client. the code is as shown below. i call the same code when i first connect to the FTP server and the code does the directory listing successfully. but when i call the same code to refresh the directory listing, the code fails.. just see where i am doing the mistake..
//delete all items in the listCtrl
m_cListDir.DeleteAllItems();
try
{ CString pStrptr;
CString str;
BOOL nRC = pConnect->GetCurrentDirectory(pStrptr);
pStrptr.Format("%s is the current directory", pStrptr);
MessageBox(pStrptr, " Info", MB_OK);
// use a file find object to enumerate files
CFtpFileFind finder1(pConnect);
pConnect->SetCurrentDirectory(pStrptr);
BOOL bWorking = finder1.FindFile( _T("*"));
if(bWorking)
{
int i = 0;
CString str;
CTime time;
while (bWorking)
{
bWorking = finder1.FindNextFile();
//display the file name, file size and last modified in a listctrl box
str.Format("%u byte(s)",finder1.GetLength());
m_cListDir.InsertItem (i,((LPCTSTR) finder1.GetFileTitle()));
m_cListDir.SetItemText(i,1,(LPCSTR)str);
finder1.GetLastAccessTime(time);
str.Format("%d-%d-%d",time.GetDay(),time.GetMonth(), time.GetYear());
m_cListDir.SetItemText(i++,2,(LPCSTR)str);
}
}
else
{
CString str;
MessageBox("'/' is empty", "Info", MB_ICONINFORMATION);
str.Format("Error : %s", GetLastError());
MessageBox(str, "Error",MB_ICONERROR);
}
}
catch (CException* pEx)
{
TCHAR sz[1024];
pEx->GetErrorMessage(sz, 1024);
MessageBox("Cannot retrive the server drive information","ERROR!",MB_ICONERROR);
pEx->Delete();
}
vijay aroli
|
|
|
|
|
aroli vijay wrote: ...when refresh button is pressed, the directory listing fails.
Which means what exactly? Set a breakpoint in your code and narrow the problem down to just a few statements.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi!! thanks to everyone. the problem has been solved. i didnot close the find file object after enumerating all the files once. that was the cause for the problem. thanks to everyone
vijay aroli
|
|
|
|
|
I am looking for the most basic example of word automation. I have looked at all of them on this webiste and they are all too complex for me. All I need is couple of lines of code (no interface at all) on how to create a completely blank word file with the path specified by me (like c:\\myfile.doc). How can I do that??
Thanks in advance!
|
|
|
|