|
Hi,
I have an MFC unicode application which needs to access a database which is UTF-8 encoded. Iam accessing the database through direct query excution using ExecuteSQL function.ExecuteSQL functions expects an LPCTSTR which will be be LPCWSTR under _UNICODE , so i need to format the query as UTF-16 and pass to the ExecuteSQL right?, but the DB is UTF-8 encoded.I need to know whether this will cause any problems.?
Thanks
Krish
|
|
|
|
|
i am doing an word automation application in vc++. Here i need to create tables, which i have done. Now i need to set the borders for the tables. the tables that are created does not have borders by default.
i did some R&D and created gridlines. But that is not what i wanted. I wanted borders for the tables. Please give me some leads on this
|
|
|
|
|
Please see this automation code (VB) this will give a hint
.Borders(wdBorderTop)
.LineStyle = Options.DefaultBorderLineStyle
.LineWidth = Options.DefaultBorderLineWidth
.Color = Options.DefaultBorderColor
Shows that you should select the Borders collection of particular table and then set the LineStyle and LineWidth values/properties.
Also be sure that Borders.Enabled is true .
|
|
|
|
|
Hi All,
I am using CFtpConnection to upload the files on to the ftp server. It works fine for upload the files on to the server. My problem is that how i find the progress of the file i.e. how much file uploaded on to the server. please help me.
|
|
|
|
|
raj1576 wrote: My problem is that how i find the progress of the file
You could use CInternetFile's Open and Read method to write the file yourself, giving you the ability to easily calculate the progress.
Also try using CInternetSession::OnStatusCallback[^] for status updates.
|
|
|
|
|
Thanks for reply
I tried Also Open and Read method but this is synchronous but I want asynchronous. so I use CFtpConnection. I also tried OnStatusCallback but I am not getting how I use this callback function.Pls help somithing for using this callback function.
|
|
|
|
|
|
|
Hi all,
i have made a dll i want to use that dll in my program i have called the function of that dll using this code
typedef void (*function1_ptr) ();
function1_ptr function1=NULL;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
HMODULE myDll = LoadLibrary("myfile.dll");
if(myDll)
{
function1 = (function1_ptr) GetProcAddress(myDll,"function1");
if(function1)
function1();
FreeLibrary(myDll);
}
return 0;
}
i have copied my dll in debug folder, but control is not going inside if statement...
how should i do it....
can anybody please help me...
Thanks in advance
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Try giving full path in LoadLibrary.
HMODULE myDll = LoadLibrary("myfile.dll");
to something like
HMODULE myDll = LoadLibrary("C:\\Myproject\\debug\\myfile.dll");
|
|
|
|
|
What the error return code you are getting from LoadLibrary function?
|
|
|
|
|
GetProcAddress(myDll,"function1");
maybe the 2nd parameter is the key.
you could use "dumpbin /exports myfile.dll" to check the exported functions' name.
then,give the right name string.
i think your dll should include .def file
modified on Tuesday, December 29, 2009 3:16 AM
|
|
|
|
|
Le@rner wrote: but control is not going inside if statement...
Which one ? The one after the call to LoadLibrary or the one after the call to GetProcAddress ? If this is the second call, make sure that you have provided a module defintion file (.def file) as explained in the documentation[^]
|
|
|
|
|
hi:
How to generate random file names? It is better provide a simple method. thanks 
|
|
|
|
|
Have you tried GetTempFileName() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
|
|
|
|
|
|
UINT GetTempFileName(
LPCTSTR lpPathName, // pointer to directory name for temporary
// file
LPCTSTR lpPrefixString, // pointer to filename prefix
UINT uUnique, // number used to create temporary filename
LPTSTR lpTempFileName
// pointer to buffer that receives the new
// filename
);
I am not a genius, but shed more sweat!
|
|
|
|
|
Filename extension from .tmp to .txt or another? how to do
|
|
|
|
|
Find .tmp and replace it to .txt in the generated filename string 
|
|
|
|
|
May I get filename which like *.txt directly using GetTempFileName() 
|
|
|
|
|
Did you read the docs? It plainly states that a .tmp extension will be used.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
|
|
|
|
|
Hi
Because I used multi-inheritance in my application. I can not use MFC default file serialization. I have to implement file saving and reading function myself.
My question is how to save/read a class information to/from file.
If I save a class information with class name and its property into the file. How do I know the character string in the file is a class name or not?
Thanks,
|
|
|
|
|
|
I got an error:
\utility\std_serialize.h(102) : error C2039: 'hash_map' : is not a member of 'std'
Thanks
|
|
|
|
|
Try adding #include <hash_map> in std_serialize.h .
modified on Monday, December 28, 2009 10:44 PM
|
|
|
|