|
|
You are welcome.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
So....you have:
CBase* pArray[] = { whatever... };
CBase* pItem = address_of_some_item_in_the_array; ?
In that case:
const size_t index = pItem - pArray;
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Hi,
May i know how to check if a folder or file exists and if not create a folder....
im using ...
CString csPath1="C:\\Temp\\myfolder";
if(_access (csPath1+_T("\\Test"), 0)==-1);
::CreateDirectoryW(csPath1+L"\\Test",NULL);
and im getting the below error....
'_access' :cannot convert parameter 1 from 'ATL::CStringT<BaseType,StringTraits>' to 'const char *'...
Please help me......(myproject is in unicode)
|
|
|
|
|
Why do you need to check first?
CreateDirectory will return ERROR_ALREADY_EXISTS if the directory already exists.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks for ur help and please let me know how can i check whether a file(not directory) exists....(my project is in unicode)........
|
|
|
|
|
You can use PathFileExists()[^] function (works with both folders and files).
The page contains a sample as well - saves me from typing code. Do remember to include shlwapi.h and link to shlwapi.lib .
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
How can I use DLL file in C#.NET ? I create dll in Borland C++ Compiler 5.5.1 and using C language.
Following code is not work.
My C Code;
-----------------------------------------------------
//hello.dll
#include <windows.h>
extern "C"
{
void __declspec (dllexport) function1()
{
MessageBox (NULL, "test message","test title",0);
}
}
BOOL WINAPI DllMain (HINSTANCE, DWORD, LPVOID)
{
return TRUE;
}
My C# Code;
-----------------------------------------------------
[DllImport("C:\hello.dll")]
public static extern void function1();
private void button1_Click(object sender, EventArgs e)
{
function1();
}
|
|
|
|
|
Ok, I try this; But I get this error: Entry Point Not Found
C DLL CODE
-----------------------------------------------
#include <windows.h>
BOOL __stdcall DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved) {
return TRUE;
}
__declspec(dllexport) void __stdcall Message(char* p_szMessage) {
MessageBox(NULL, p_szMessage, "Message from DLL", MB_OK);
}
C# DLL CODE
-----------------------------------------------
[DllImport("filename.dll")]
static extern void Message(string msg);
private void button1_Click(object sender, EventArgs e)
{
Message("Hello world");
}
|
|
|
|
|
What does it mean, specifically, 'it doesn't work' (i.e. more details needed)?
BTW you possibly would get better help at C# forum.
BTW2: I saw you've already cross-posted your question...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
cross-posted is forbidden? Because this question related about between c and c#.
How can I "dumpbin -exports dll" in borland c++ 5.5.1 compiler on command prompt?
Do you have any idea?
|
|
|
|
|
Hi,
how do we send structure data on tcp socket ?
any code snippets ?
Jalsa
|
|
|
|
|
jalsa G wrote: how do we send structure data on tcp socket ?
Just like any other binary data.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
It doesn't matter what you're sending, just make sure the size of data is mentioned correctly.
You may need to typecast the data as char* 'cause that's what the function accepts.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
«_Superman_» wrote: It doesn't matter what you're sending
Provided you're not sending pointers...
--Carlo the Nitpick.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Also, an old Greek mythic legend states that you cannot (and should not) send tomatoes on socket.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: Also, an old Greek mythic legend states that you cannot (and should not) send tomatoes on socket.
Of course, since old Greeks did not know both of tomatoes and sockets.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello All,
I want to add Message handler for a generic class in Visual Studio 2008(VC++).
I have a generic class suppose CDataDisplay, Which don't having any base class. I want to create message map for this class.
How can i do this? If anyone having idea please help with some code.
Thanks,
Abhijit
|
|
|
|
|
Hi,
How can i give or set a picture above a button. My application is MFC application. Like copy, cut button on toolbar. What will be the image format.
Thanks & Regards
Shaheen
|
|
|
|
|
You may use a CBitmapButton [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
I have made a dialog based application in vc2008, in that application i have created a list control. In that list control i am displaying file names from a particular folder......
suppose folder contains 2500 files and allfiles are bmp type, i am also displaying system icon(which is picked up from system at runtime only) in front of every file.
Now the problem is as soon as i click on adding file to my list control only border of my list ctrl is displyed and everything becomes white and after some time not responding status is being shown and after some time application crashes. i have monitored its memory usage from task manager it exceeds very fast and its very high...
i am not getting how to resolve it and infact what exactly the problem is...
can anybody help me in this....
|
|
|
|
|
Hi,
the symptoms you describe typically appear when another thread is accessing some controls that were originally created by the main thread. Only the main thread should ever touch any of the controls,
they are not thread-safe. You probably have to rethink the threading scheme used.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
You could process messages from time to time in order to keep the UI alive, something like this:
MSG msg;
while (::PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE))
{
if (!(AfxGetApp()->PumpMessage()))
{
::PostQuitMessage(0);
break;
}
}
Don't know why your app is using so much memory, 2500 items isn't that much...
|
|
|
|
|
Michael Schubert wrote: Don't know why your app is using so much memory, 2500 items isn't that much...
Except if he is loading 2500 big bmp files
|
|
|
|