|
Following on from Luc's comments, this cannot work as it stands. The C++ method is expecting a reference to a C++ std::wstring class, and you cannot create one in VB. The only answer is to write a C++ wrapper to the DLL which will accept a reference to a character array and then use that intermediate code to convert between that and the wstring type.
MVP 2010 - are they mad?
|
|
|
|
|
Thanks gentlemen for your inputs. I will remove the dust on my old C++ book and go with the wrapper.
|
|
|
|
|
We have a legacy system (in C++/MFC/C# .NET), that talks to SQL server database.
At that time, the Db was not designed for internationalization. Hence the string fields in Db are of type varchar.
One option is to change the varchars to nvarchars. This increases the Db size by 50%.
The existing users of the app would not want to have this, with no tangible benefit.
But it is essential for us to support internationalization.
Is it possible to have 2 sets of Db, one for existing customers and another for new customers (with nvarchar)
with the same code base, or some minor modifications to the code?
Open to ideas/suggestions/comments or questions.
Thanks,
Saleem
|
|
|
|
|
Md Saleem Navalur wrote: One option is to change the varchars to nvarchars. This increases the Db size by 50%.
The existing users of the app would not want to have this, with no tangible benefit.
What difference would it make to the users? Do they specify a limit to the size of the database or are there other limiting factors?
In any case the tangible benefit is that it can now support internationalisation.
Md Saleem Navalur wrote: Is it possible to have 2 sets of Db, one for existing customers and another for new customers (with nvarchar)
with the same code base, or some minor modifications to the code?
At the very least it would be pretty difficult to maintain with 2 'almost' identical databases.
|
|
|
|
|
Yes the size of the Db matters, its already close to 1 TB. Making nvarchars would increase this substantially. Existing users dont really care about localization as they are always in en-US culture.
It is for the new users, we have an issue.
Saleem
|
|
|
|
|
Md Saleem Navalur wrote: s it possible to have 2 sets of Db, one for existing customers and another for new customers (with nvarchar)
with the same code base, or some minor modifications to the code?
Your data access layer should be flexible enough to support this. If it's V1.0, use database A, if V2.0, use database B.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi all ,
As part of my presentation @ Community Tech Days which was held at Kochi (INDIA ) , I had written a Compiler to demonstrate run time code generation using Reflection.Emit.
The Source Language is called SLANG4.net. The Project is hosted @ http://slangfordotnet.codeplex.com.
The compiler is devoleped in stages to aid comprehension. Detailed documentation is available in the Zip bundle.
regards
Praseed Pai
http://praseedp.blogspot.com
|
|
|
|
|
Hi all,
Is it possible to read / write data to / from the clipboard using a COM interface? I'm writing a Silverlight app and the SIlverlight framework only allows for reading & writing text, I however need to write a JPEG byte array, and I'm running as a trusted application so I have extensive COM available.
My second question is around how to write binary data to the clipboard so that Excel sees it as an Image (SL does not have an Image object type), anyone ever done that before?
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
Your question will probably get better visibility in the correct forum.
MVP 2010 - are they mad?
|
|
|
|
|
I am designing a distributed application hosted in NET 3.0. This is intended to have a common user interaction point - Control GUI.
Any number of components providing different functionality may be running at one time but the Control GUI should reflect only those components which are running.
The idea is something like this - as different components activate themselves the Control GUI should expand to accomodate any new fuctionality the new component provides.
This would seem to require serialising a new GUI component to the Control GUI and inserting it into the Control GUI process (app domain) as a plug-in.
There is lots of info around about plug-in managers but not too much about how to serialise the GUI.
I am not looking for a complete solution but ideas or pointers as to where to look would be appreciated.
Thanks in advance
Peter Wasser
modified on Thursday, February 4, 2010 3:10 AM
|
|
|
|
|
Hi,
I am using the following MSDN Asynchronous Server Socket example:
http://msdn.microsoft.com/en-us/library/fx6588te(VS.80).aspx[^]
Problem is that when I embed this code in a Windows service, it gives me a error "Error 1053: The service did not respond to the start or control request in a timely fashion" & the service remains in "Starting" state.
Need help, I'm kinda stuck here.
Thanks.
Additional Info:
This windows service is to act as server listening to 'n' number of socket clients connecting & sending data.
modified on Thursday, February 4, 2010 5:08 AM
|
|
|
|
|
Hi,
I guess you put the code into the starting method of the service. This will create a timeout since the service is waiting for a connection (cause by the WaitOne-call). So you should not wait for a connection within the starting method of the service. If I'm wrong please provide the code within the start method of the service so the error is easier to found.
Regards
Sebastian
|
|
|
|
|
yes, you are right. I looked at the code & found that in the StartListening method there is a while(true) loop in which there is a WaitOne call.
any ideas how can I resolve this ? Should I call the StartListening method in a seperate thread from the ServiceMain (OnStart) function ?
Any ideas will be of gr8 help.
Thanks
|
|
|
|
|
There is no need to start a seperate thread. Since you are using an asynchronous socket you can easily start listening. The while-loop with the waitone is in the example program, because the application will stop when the main-method ends. Since the service is running as long it is not stopped, the socket will listen also. So you should remove the while-loop with the wait-statement. Don't forget to close the socket when the service stops.
Regards
Sebastian
|
|
|
|
|
Hi Sebastian,
Thanks for your reply.
Sorry, but in a hurry I missed some additional explanation regarding my requirement.
I have Edited my post accordingly.
"
Additional Info:
This windows service is to act as server listening to 'n' number of socket clients connecting & sending data."
I guess if I remove the while loop the service will be able to accept only one connection & any other client will not be able to connect.
My windows service has to keep listening to client socket connection that can happen at any time & process the data that client passes.
Hence I guess the while loop will be required.
Also I read a little about WaitOne in MSDN & it is for thread synchronization incase more than 1 client tries to connect simultaneously.
Any ideas ?
Thanks.
|
|
|
|
|
Yes, the WaitOne is for thread synchronization. If I get the idea of the Asynchronous Socket right the socket waits for a client to connect. If a client connects the event handler is called. Within the example the event handle calls a "EndAccept". So I guess, if you call listener.BeginAccept afterwards the listener-socket is ready for the next client to connect.
By the way, did you checked the TcpListener class. I think using this class in a seperate thread will be easier than using this asynchronous socket...
Regards
Sebastian
|
|
|
|
|
HELLO Experts,
Actually I want to Create PDF OF ALL PRINTING DOCUMENTS. SO I WANT TO CREATE A PRINTER DRIVER FOR DOING THIS.
SO PLEASE HELP ME FOR CREATING PDF FILE BY USING VB.NET OR C#.
THANKS A LOT
If you can think then I Can.
|
|
|
|
|
eg_Anubhava wrote: Actually I want to Create PDF OF ALL PRINTING DOCUMENTS.
Please don't shout
eg_Anubhava wrote: SO PLEASE HELP ME FOR CREATING PDF FILE BY USING VB.NET OR C#.
I'm afraid that's not possible. Device Drivers[^] are written in native, not in managed code.
I are Troll
|
|
|
|
|
Do u have any idea for Converting any document (Like : Word,Notepad) to PDF Format.
If you can think then I Can.
|
|
|
|
|
|
I thought I'd have a play with Enterprise Application Blocks (an add-on for VS2008 from Microsoft). But I'm getting something odd.
I installed it (v4.1), added the necessary references to my project, and used the Enterprise Library Configuration tool to set up a simple ExceptionHandler with logging. Then to test it I hard-wired a divide-by-zero error into my application code (inside a try-catch block). Everything compiles okay but when I get to the deliberate error it crashes with a message about not being able to load an assembly due to a mismatch in the manifest.
I tried different ways of referencing the DLLs and cleaned the solution but without success. But then I found if I manually edit the app.config (which the Enterprise Library Configuration tool modifies) and remove the version, culture, and public key token from all the 'type' attributes ... it works! (I noticed the supplied QuickStart samples didn't have this in their app.config which is what led me to try the same in my application. Also, an eyeball check of the DLL metadata implied I have the correct versions.)
Thing is, every time I go back into the Enterprise Library Configuration tool it adds these bits back in. Am I doing something wrong or is this a bug in the tool? Anyone else have experience of this?
|
|
|
|
|
hi,
I am using entity data model and i have master-detail scenario.(Patient-PatientAddresses)
Everything is going on fine if i am updating any data either in master table or detail table.
But when i am going to insert a new detail record while updating master entity, it gives me following error :
"An object with the same key already exists in the ObjectStateManager. The ObjectStateManager cannot track multiple objects with the same key."
I googled so much, but not getting proper idea.
Here is my code :
using (var context = new Entities())
{
try
{
var record = (from p in context.Patient.Include("PatientAddress")
where p.PatientId == patient.PatientId
select p).FirstOrDefault();
if (record == null)
{
context.AddToPatient(patient);
}
else
{
foreach (var item in patient.PatientAddress)
{
if (item.EntityKey == null)
{
context.AddToPatientAddress(item);
continue;
}
context.ApplyPropertyChanges("PatientAddress", item);
}
context.ApplyPropertyChanges("Patient", patient);
}
context.SaveChanges();
return true;
}
catch
{
return false;
}
}
Any suggessions is appreciated.
modified on Wednesday, February 3, 2010 9:55 AM
|
|
|
|
|
Fix your post. The code is unreadable.
|
|
|
|
|
Sorry but i can read it from here.
Can you tell me which lines of the code you are not able to read?
|
|
|
|
|
It's OK now. The first time I looked at it, the entire code snippet was on a single line and you had to scroll left and right to read it all.
|
|
|
|